Java
-
JSP sessionscope object: an implicit object that accesses the session scope
${sessionScope.expression} Example ${sessionScope.user} Typical application <body> <p>EL对象使用<…… -
Hibernate wascommitted method: judge whether the transaction is committed
wasCommitted() Example session.saveOrUpdate(uf); //调用插入数据方法 if(tx.wasCommitted()){ //判断事务是否已经被提…… -
JSP JSTL < C: choose > Tags: select Tags
< C: choose > < C: when > business logic < / C: when >... <-- Multiple < C: when > tags -- …… -
Hibernate connection. Password property: Specifies the database connection password
hibernate. connection. Password = attribute value Example 1 <property name="hibernate.connection.password"><…… -
Hibernate clear method: empty cache
clear() Example Session session = sessionFactory.openSession(); //定义Session UserForm uf = new UserForm(); //定…… -
Struts2 ActionContext. Getapplication () method: get the application object of map type
public Map getApplication() Example Typical application Info value in the request range: Info value in the session ran…… -
Spring drivermanagerdatasource class: Drive Manager data source
Grammar 1 DriverManagerDataSource() Example DriverManagerDataSource driverManagerDataSource = new DriverManagerDataS…… -
Spring getconnectionproperties method: get database connection properties
getConnectionProperties() Example public static void main(String[] args){ String driver = "com.MysqL.jdbc.Driver"…… -
Java RandomAccessFile class: dynamic reading of file contents
Example 1 public class RandomAccessFileDemo { public static void main(String[] args) { try { …… -
Implementation of java example air ticket discount in low and peak seasons
Use if else statement to realize air ticket discount in low and peak seasons public static void main(String[] args) …… -
Java interface: definition and implementation of interface, definition and implementation of interface
Define interface public interface A { publicA(){…} // 编译出错,接口不允许定义构造方法 } public interface…… -
Spring batchupdate method: execute batch update statement
batchUpdate(String[] sql) Example public static void main(String[] args){ ApplicationContext context = new ClassP…… -
JSP Request. Getsession () method: get the session object related to the request
getSession(boolean create) Example <% HttpSession ses = request.getSession(true); out.println("客户端sessio…… -
JSP JSTL < x: param > tag: define parameters
parameter value Example <%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%> <%@taglib…… -
JSP JSTL < SQL: setdatasource > tag: set data source
Example 1 <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%> 连接Sql Server 2000数据库 &…… -
JSP header object: get a specific header value of HTTP request
${header.expression} Example ${header.host} ${header[host]} -
Hibernate hibernate. transaction. factory_ Class attribute: sets the transaction management type
hibernate. transaction. factory_ Class = attribute value Example <property name="hibernate.transaction.factory_cl…… -
Struts2 ActionContext. Getcontext () method: get actioncontext object
public static ActionContext getContext() Example //获取ActionContext对象 ActionContext context = ActionContext.getC…… -
Hibernate between method: set the condition between the two
between(String propertyName,Object lo,Object hi) Example Criteria criteria = session.createCriteria(UserForm.class);…… -
JSP initparam object: get the value of the initialization parameter of the web application
${initParam.expression} Example <context-param> <param-name>author</param-name> <param-va…… -
Hibernate buildsessionfactory method: build sessionfactory
buildSessionFactory() Example Configuration config = new Configuration().configure(); //创建Configuration对象 Sess…… -
Springweb < form: Select > tag: defines a drop-down selection box or a list selection box
Example public class NewBean{ private List fanList; private String date; public String getDate(){ ret…… -
Hibernate createquery method: creates a query object
createQuery(String queryString) Example Session session = sessionFactory.openSession(); //定义Session对象 String h…… -
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…… -
Java imitation landlords shuffle licensing games
public class Main { public static void main(String[] args) { // 1. 准备牌 String[] arr1 = { "…… -
Hibernate addscalar method: returns a combination of scalar and entity
addScalar(String columnAlias,Type type) Example String sql = "select avg(result.english)as avgEnglish from tb_result…… -
JSP cookie object: access the cookie name set by the request
${cookie expression} Example <%Cookie cookie = new Cookie("user","zs"); response.addCookie(cookie); %> …… -
-
JSP Response. Setmaxinactivival() method: set the validity period of the session
setMaxInactiveInterval(int interval) Example <% session.setMaxInactiveInterval(30); %> -
Detailed explanation of Java if else statement
If statement syntax if ( 条件表达式) { 语句块; } Example 1 import java.util.Scanner; public class Test07 …… -
JSP Response. Getcreationtime () method: get the time when the session object was created
getCreationTime() Example <% session.setAttribute("user","zs"); long timenum = session.getCreationTime(); …… -
Hibernate or method: logic or operation
or(Criterion lhs,Criterion rhs) Example Criteria criteria = session.createCriteria(PersonForm.class); //定义Criteri……
