包含标签:Java 的文章
-
Java collections classes: sort() ascending sort, reverse() descending sort, copy() copy, fill()
Forward sort Example 1 public class Test10 { public static void main(String[] args) { Scanner input = …… -
Hibernate isclosed method: judge whether the sessionfactory object is closed
isClosed() Example if(sessionFactory.isClosed()){ //判断SessionFactory对象是否关闭 System.out.println("SessionFa…… -
Struts 2 include tag: contains the page tag
Example <body> <h3>使用include标签包含jsp1.jsp</h3> <jsp:include page="jsp1.js…… -
JSP Response. Senderror() method: sends an error message to the client
sendError(int sc) Example <% response.sendError(404); %> -
Spring getbeansoftype method: get the JavaBean of the specified type
getBeansOfType(Class type) Example public static void main(String[] args){ ApplicationContext context = new Class…… -
Spring executefind method: callback query operation
executeFind(HibernateCallback action) Example public List getSmallUser(final Integer ID){ HibernateTemplate htm =…… -
Spring setpassword method: set the password to connect to the database
setPassword(String password) Example DriverManagerDataSource dmd = new DriverManagerDataSource(); dmd.setPassword(p…… -
Hibernate groupproperty method — sets the property column participating in the grouping
groupProperty(String propertyName) Example Criteria criteria = session.createCriteria(UserForm.class); //获取Criter…… -
Hibernate begintransaction method: start a transaction
beginTransaction() Example Transaction tx = null; //定义事务对象 try{ tx = session.beginTransaction(); //开启…… -
Spring execute method: callback execution
execute(HibernateCallback action) Example public TbUser getUser(final Integer ID){ HibernateTemplate htm = getHib…… -
JSP JSTL < C: when > tag: condition tag
< C: when test = "condition" >... Label body < / C: when > Example <%@taglib prefix="c" uri="http://j…… -
Detailed explanation of Java static static modifiers: static variables, static methods and static code blocks
类名.静态成员 Static variable public static double PI = 3.14159256; Example 1 public class StaticVar { publ…… -
JSP JSTL < FMT: bundle > tag: read binding message resources
body content Example <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> <fmt:bundle…… -
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…… -
Struts 2 < action > element: establish the mapping of action objects
Syntax 1: url Example import com.opensymphony.xwork2.ActionSupport;/** *用户信息管理Action *@author …… -
Hibernate close method: close the sessionfactory object
close() Example sessionFactory = config.buildSessionFactory(); //创建SessionFactory对象 if(sessionFactory.isClosed…… -
How about your salary? What are the employment directions?
Web development Android Development Client development Game development -
Hibernate hibernate. max_ fetch_ Depth attribute: sets the grab depth
hibernate. max_ fetch_ Depth = attribute value Example <property name="hibernate.max_fetch_depth"> 1 </…… -
Struts 2 interceptor interface: interceptor
Syntax: public interface Interceptor extends Serializable{ void destroy(); void init(); String intercept(Ac…… -
Struts 2 basic configuration file
<struts> <!—设置常量的值--> <constant name="name" value="value"></constant> …… &…… -
Hibernate criteria interface setprojection method: sets the projection column of the query
setProjection(Projection projection) Example 1 Criteria criteria = session.createCriteria(UserForm.class); //示例化…… -
Struts 2 < include > element: contains other configuration files
Syntax: …….. < include file="file"/> Example <!DOCTYPE struts PUBLIC "-//Apache Software Foundatio…… -
The difference between Java empty string and null
String str = null; System. out. println(str.length()); if (str.length() == 0) if (str.equals("")) if (str == null) if …… -
Hibernate default_ batch_ fetch_ Size attribute: sets the default fetching quantity
hibernate. default_ batch_ fetch_ Size = attribute value Example <property name="hibernate.default_batch_fetch_si…… -
Hibernate isnotnull method: judge whether it is not null
isNotNull(String propertyName) Example Criteria criteria = session.createCriteria(PersonForm.class); //创建Criteria…… -
JSP requestscope object: an implicit object that accesses the scope of the request
${requestScope.expression} Example ${requestScope.user} -
JSP Response. Getmaxinactivival() method: get the valid time of the session
getMaxInactiveInterval() Example <% long timeNum = session.getMaxInactiveInterval(); out.println("这个sessi…… -
JSP Response. Setstatus() method: sets the status code of the response
setStatus(int sc) Example <% response.setStatus(200); %> -
Hibernate hibernate. use_ identifer_ Rollback attribute: reset default
hibernate. use_ identifer_ Rollback = attribute value Example <property name="hibernate.use_identifer_rollback"&g…… -
Hibernate get method: load entity objects through oid
get(Class clazz,Serializable id) Example Session session = sessionFactory.openSession(); //创建session对象 UserFor…… -
Tomcat installation and startup
In addition to tomcat, commonly used servlet containers include Weblogic, JBoss, webspher, etc. Selection of Tomcat ve…… -
Why use up transformation instead of directly creating subclass objects?
Example 1 public class Animal { public void sleep() { System.out.println("小动物在睡觉"); } ……