Java
-
Struts 2 checkboxlist tag: create multiple checkboxes at a time
< / s: check@R_947_2419 @List > / / display of multiple selection boxes < / s: Form > Examp…… -
Servlet life cycle (illustration)
Methods related to servlet life cycle 1) Init() method 2) Service() method 3) Destroy() method Servlet lifecycle (thre…… -
Hibernate Ge method: set the condition greater than or equal to
ge(String propertyName,Object value) Example Criteria criteria = session.createCriteria(UserForm.class); //创建Crit…… -
Does java have multidimensional arrays?
type[][] arrName; arrName = new type[length][] public class TwoDimensionTest { public static void main(String[]…… -
Struts2 ActionContext. getContext(). Get (object key) method: get the request of map type
public Object get(Object key) Map request = ActionContex.getContext.get("request"); @H_404_7@ 说明:ActionContext …… -
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 JSTL < C: out > tag: output tag
grammar Syntax format 1: Syntax format 2: defalultValue Example <%@taglib prefix="c" uri="http://java.…… -
Hibernate cache. region_ Prefix attribute: sets the prefix name of the L2 cache
hibernate. cache. region_ Prefix = attribute value Example <property name="hibernate.cache.region_prefix"> …… -
Java calculates (judges) constellations based on the date of birth
白羊:0321~0420 天秤:0924~1023 金牛:0421~0521 天蝎:1024~1122 双子:0522~0621 射手:1…… -
Hibernate cache. provider_ Class attribute: sets the full name of the L2 cache implementation class
hibernate. cache. provider_ Class = attribute value Example <property name="hibernate.cache.provider_class"> …… -
Hibernate close method: close the session object
close() Example Session session = sessionFactory.openSession(); //创建Session对象 if(session.isopen()){ //如果ses…… -
Hibernate opensession method: open a session
Grammar 1 openSession() Example SessionFactory sessionFactory = config.buildSessionFactory(); Session session = ses…… -
Hibernate configuration properties
<?xml version='1.0'encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Co…… -
Java instance guessing numbers games
count=0 way=0 public class BullCows { /** * 负责调用对应的方法,实现整个案例的逻辑关系 * * @p…… -
Encryption and decryption of Java strings
public static String encryptAndDencrypt(String value,char secret) { byte[] bt = value.getBytes(); // 将需要加密…… -
Nine palace grid memory network of Java project practice
Development background requirement analysis System objectives Functional structure System flow development environment…… -
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 ……