Java
-
JSP Response. Isnew() method: judge whether the current user is a new user
isNew() Example <% out.print(session.isNew()); %> -
Library management system for Java project practice (with source code and analysis)
Development background requirement analysis System objectives System functional structure System flow development envi…… -
Java check file name and email address
public static void main(String[] args) { boolean filecon = false; // 判断文件名是否合法 boolean emailcon =…… -
Struts 2 checkboxlist tag: create multiple checkboxes at a time
< / s: check@R_947_2419 @List > / / display of multiple selection boxes < / s: Form > Examp…… -
Encryption and decryption of Java strings
public static String encryptAndDencrypt(String value,char secret) { byte[] bt = value.getBytes(); // 将需要加密…… -
Spring setdriverclassname method: set the driver class of the data source
setDriverClassName(String driverClassName) Example public static void main(String[] args){ String driver = "com.M…… -
Hibernate hibernate. use_ identifer_ Rollback attribute: reset default
hibernate. use_ identifer_ Rollback = attribute value Example <property name="hibernate.use_identifer_rollback"&g…… -
Java computing GPA
import java.util.InputMismatchException; import java.util.Scanner; public class Test03 { public static void…… -
Detailed explanation of Java object class: common methods of object class (equals() and getclass())
public class MyClass{…} public class MyClass extends Object {…} Equals() method boolean result = obj.equals(Obje…… -
Java project: the development of Tianxia Taoshang mall system
Development background requirement analysis Functional structure System flow development environment System Preview F…… -
JSP JSTL < x: out > tag: output XML information
Example <%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%> <%@taglib prefix="c" uri="ht…… -
JSP JSTL < C: choose > Tags: select Tags
< C: choose > < C: when > business logic < / C: when >... <-- Multiple < C: when > tags -- …… -
Struts2 ActionContext. Getcontext () method: get actioncontext object
public static ActionContext getContext() Example //获取ActionContext对象 ActionContext context = ActionContext.getC…… -
Spring geturl method: get the URL path to access the database
getUrl() Example public static void main(String[]args){ String driver = "com.MysqL.jdbc.Driver"; String url = …… -
Spring setusername method: set the user name to access the database
setUsername(String username) Example DriverManagerDataSource dmd = new DriverManagerDataSource(); dmd.setUsername("…… -
Hibernate query interface setDate method: bind parameters with mapping type of date
Grammar 1 setDate(int position,Date date) Example String hql = "from UserForm where birthday=?"; //定义查询HQL语句 …… -
Setmaxresults method of Hibernate criteria interface: set the maximum number of returned records
setMaxResults(int maxResults) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria示…… -
Hibernate query interface setentity method: used to bind entity class parameters
setEntity(String name,Object val) Example Dept d = new Dept(); //定义表示部门实体的JavaBean对象 d.setId(3); //设…… -
JSP headervalues object: get all header values of HTTP request
${headerValues.expression} Example ${headerValues["user-agent"]} -
Servlet life cycle (illustration)
Methods related to servlet life cycle 1) Init() method 2) Service() method 3) Destroy() method Servlet lifecycle (thre…… -
Nine palace grid memory network of Java project practice
Development background requirement analysis System objectives Functional structure System flow development environment…… -
Struts 2 < action > element: establish the mapping of action objects
Syntax 1: url Example import com.opensymphony.xwork2.ActionSupport;/** *用户信息管理Action *@author …… -
Hibernate get method: load entity objects through oid
get(Class clazz,Serializable id) Example Session session = sessionFactory.openSession(); //创建session对象 UserFor…… -
Java StringBuffer replaces special characters
import java.util.Scanner; public class test2 { public static void main(String[] args) { System.out.…… -
Hibernate distinct method: set the uniqueness of query results
distinct(Projection proj) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criteria对象 c…… -
Hibernate addjoin method: associate an entity with a collection
addJoin(String alias,String path) Example Session session = sessionFactory.openSession(); //创建Session对象 String…… -
Simple blog system development of Java project practice (with source code and analysis)
Development background System function design 1) Foreground function module 2) Background management module System bus…… -
Hibernate connection. Password property: Specifies the database connection password
hibernate. connection. Password = attribute value Example 1 <property name="hibernate.connection.password"><…… -
Hibernate between method: set the condition between the two
between(String propertyName,Object lo,Object hi) Example Criteria criteria = session.createCriteria(UserForm.class);…… -
JSP Response. Getservletcontext() method: returns the ServletContext object to which the session belongs
getServletContext() Example <% ServletContext sc = session.getServletContext(); %> -
JSP Response. Addheader() method: add HTTP header information
addHeader(String name,String value) Example <%=new Date()%> <% response.addheader("Refresh","1"); …… -
JSP Response. Getoutputstream () method: get the output stream of the JSP response object
getOutputStream() Example <% ServletOutputStream os = response.getOutputStream(); os.write("<b>Java编……
