1. Get the Project path: Request.getcontextpath ();
2. Get the requested parameter: Request.getquerystring ();
3. Specify the character encoding format for the request: Urlencoder.encode (text, "UTF-8");
Configure the servlet parameter in 4.web.xml,
<init-param>
<param-name>xx</param-name>
<param_value>yy</param_value>
</init-param>
To read this parameter in the servlet, override the Init method
5.${} represents a JSP built-in object
6.<%%>jsp Small Script
7.java.lang.threadlocal.get () method returns the value in the current thread copy of this thread's local variable
8. Determine if a string array contains a string:
such as: string[] ss = {"1", "2", "3"};
String s = "1";
Boolean Iscontanis = Arrays.aslist (ss). contain (s);
9. String interception
Example: String str = "All-in-all"
sring[] STRs = Str.split (","); split string by specified character
Str.substring (2); intercept from the specified index bit to the end, subscript starting from 0
Str.substring (2,4); intercept from start index bit to end index bit, contains start index does not contain end index
10. Get the file name when uploading: File.getoriginalfilename ()
11. In the JSP page, if you need to format the date format from the background, you can use
<fmt:formatdate value= "${biztoservice.addtime}" type= "both" pattern= "Yyyy-mm-dd HH:mm:ss"/>
12.fn:replace () function syntax: ${fn:replace (< original string;, < substituted string, < string to replace >)}
The 13.<c:url> tag formats the URL as a string and then stores it in a variable.
such as: <c:url value= "/xfspcontroller/broswer.do" var= "Pageurl" >
</c:url>
The common small knowledge point finishing of Java EE