Java
-
Verifying IP addresses with Java regular expressions
\d{1,3}\.\d{1,3} import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; publ…… -
Hibernate query interface setdouble method: bind parameters with mapping type of double
Grammar 1 setDouble(int position,double val) Example String hql = "from GoodsForm where price=?"; //定义查询HQL语句…… -
Struts 2 set tag: defines a variable
Example <body> <!--将表达式user.username的值保存在默认范围中,即action范围--> <s:set name="…… -
Java judges leap year and average year and outputs the number of days of a month
import java.util.Scanner; public class Test27 { public static void main(String[] args) { // 在这里编…… -
Detailed explanation of Java break statement
Terminate a sequence of statements in a switch statement Use the break statement to forcibly exit the loop directly Ex…… -
JSP Response. Senderror() method: sends an error message to the client
sendError(int sc) Example <% response.sendError(404); %> -
Struts 2 interceptor interface: interceptor
Syntax: public interface Interceptor extends Serializable{ void destroy(); void init(); String intercept(Ac…… -
JSP Response. Getid () method: get a unique ID ID
getId() Example <% String ID = session.getId(); out.println("这个session的ID是:"+ID); %> -
What about Java null objects?
Student stu = new Student(); // Statement 1 student stu2// Statement 2 stu2 = new student()// Statement 3 String str1=…… -
Hibernate and method: logic and operation
and(Criterion lhs,Criterion rhs) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria…… -
JSP JSTL < x: set > tag: save XML node
Example <%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%> <%@taglib prefix="c" uri="ht…… -
What technology stacks do Ali P8 Java senior architects need to master?
Overall architecture design of intelligent Internet Philosophical essence of Internet super large scale architecture d…… -
Spring getconnectionproperties method: get database connection properties
getConnectionProperties() Example public static void main(String[] args){ String driver = "com.MysqL.jdbc.Driver"…… -
Hibernate createquery method: creates a query object
createQuery(String queryString) Example Session session = sessionFactory.openSession(); //定义Session对象 String h…… -
The difference between dynamic web pages and static web pages
Static web page Dynamic web page Advanced -
Java final modifier: final modifier attribute, final modifier method and final modifier class
1. Final modifies the attributes in the class 2. Methods in final modifier class 3. Final modifier class Example 1 p…… -
JSP Response. Setcontenttype() method: sets the MIME type of the response object
setContentType(String type) Example <% response.setContentType("video/x-msvideo"); %> -
Spring GetUserName method: get the user name to access the database
getUsername() Example public static void main(String[] args){ String driver = "com.MysqL.jdbc.Driver"; String …… -
Hibernate dialect property: Specifies the SQL dialect of the database
hibernate. Dialect = attribute value Example 1 <property name="hibernate.dialect"> org.hibernate.dialect.sq…… -
JSP JSTL < SQL: query > tag: query through SQL statement
Syntax: The syntax format without query conditions is as follows: actions The syntax format of query cri…… -
-
Spring getbeansoftype method: get the JavaBean of the specified type
getBeansOfType(Class type) Example public static void main(String[] args){ ApplicationContext context = new Class…… -
Struts 2 basic configuration file
<struts> <!—设置常量的值--> <constant name="name" value="value"></constant> …… &…… -
Setmaxresults method of Hibernate query interface: set the maximum number of returned records
setMaxResults(int maxResults) Example Session session = sessionFactory.openSession(conn); //获取session对象 String…… -
How Java creates projects
Example 1 public class HelloJava { public static void main(String[] args) { //TODO自动生成的方法…… -
JSP pagecontext object: access JSP built-in objects
${PageContext.request[expression]} Example ${PageContext.session.username} -
The difference between Java abstract classes and interfaces
1) Abstract class 2) Interface 3) The difference between abstract classes and interfaces 4) Application scenarios of a…… -
Development of local information website of Java project (similar to 58 local)
Development background System objectives System functional structure System flow System Preview Build development envi…… -
Java RandomAccessFile class: dynamic reading of file contents
Example 1 public class RandomAccessFileDemo { public static void main(String[] args) { try { …… -
Java package: Java system package and custom package
System package Custom package 1. Declaration of package package 包名; 2. Use of package example.Test test = new ex…… -
Mutual conversion of Java array and string
Convert string to array String str = "123abc"; char[] arr = str.tocharArray(); // char数组 for (int i = 0; i &l…… -
Hibernate criteria interface list method: returns a list collection
list() Example Session session = sessionFactory.openSession(); //获取session对象 List list = null; try{ Criter……
