Common attributes of page commands in jsp
1. language attributes
Sets the language used for jsp pages. Currently, only java is supported. The default value is java.
<%@ page language=java %>
2. extends attributes
Sets the java class inherited from the jsp page. Before execution, the jsp page is parsed into a Servlet by the server, and the Servlet is defined by the java class, therefore, both jsp and Servlet can inherit the specified parent class. This attribute is not commonly used and may affect server performance optimization.
3. import attributes
Set the JSP imported class package. The embedded java code snippet needs to import the corresponding class package.
<%@ page import=java.util.* %>
4. pageEncoding attributes
Specify the page encoding format, if set to ISO-8859-1, the page does not support Chinese, usually set to GBK or UTF-8
<%@ page pageEncoding=GB18030%>
5. contentType attributes
Set the MIME type and encoding of the page
<%@ page contentType=text/html; charset=UTF-8%>
6. session attributes
Specifies whether the page uses an HTTP session object. The default value is true.
<%@ page session=true%>
7. buffer attributes
Set the buffer size of the out output object on the page. The default value is 8 KB. The unit is KB only. We recommend that you use a multiple of 8 as the attribute value.
<%@ page buffer=128kb%>
8. autoFlush attributes
Sets whether to automatically refresh the cache when the page cache is full. The default value is true. If it is set to false, an exception is thrown when the cache is full.
<%@ page autoFlush=false%>
9. isErrorPage attributes
You can set the current page as an error handling page to handle errors on another JSP page, that is, an exception handling page.
<%@ page isErrorPage=true%>
10. errorPage attributes
Set the exception handling page of the current page. The isErrorPage of the corresponding exception handling page must be set to true. If this attribute is set. any error handling page defined in the xml file will be ignored, and the exception handling page defined by this attribute will be used first.
<%@ page errorPage=error/registerErrorPage.jsp%>