If you want to write anything, consider it a learning note ~ Will be added later
All basic types of non-byte types can be converted to strings using the String. valueOf () method.
The equals method is required for comparison of non-basic types.
Obtain the parameter value for form submission.
1: String name = request.getParameter(Name);
Obtain the array value of Form submission
1: String[] nameList = request.getParameterValues(ListName);
Pass parameters to the page
1: request.setAttribute(var,value);
Session operation
1: session.setAttribute(var,value);
2: session.getAttribute(var);
3: session.removeAttribute(var);
Splits a string into arrays.
1: String[] col= MyStr.split(,);
Determine the length of the array
1: MyList.length;
Converts a string to an integer.
1: Integer.parseInt(Str);
Output pass value on JSP page
1:<Bean:Write name=ObjProperty=Id/>// An attribute of an object
2:<Bean:Write name=Name/>
Map Operation Method
1: Map condition= new HashMap();
2: condition.put(name, value);
3: condition.get(name);
Date formatting
1:Date date= NewDate();
2:SimpleDateFormat df= NewSimpleDateFormat(Yyyy-MM-dd);
3:String today=Df.Format(Date);// Convert the date type to a string
4:Date day=Df.Parse(2005-08-09);
Dynamic string method StringBuffer buffer = new StringBuffer (100 );
The following two items are relatively advanced.
Date Subtraction Method
1: import java.util.*;
2: public class DateSubtraction