The full name of JSP is Java Server Pages, and the Chinese name is java server page. It is basically a simplified Servlet design. It [1] is a dynamic web page technology standard advocated by Sun Microsystems and established by many companies. .
jsp encoding settings:
1. jsp page encoding: the encoding of the jsp file itself
pageEncoding:<%@ page pageEncoding="UTF-8"%>
2. Web page display encoding: The encoding of the jsp output stream displayed in the browser
contentType: <%@ page contentType="text/html; charset=UTF-8"%>
3. HTML page charset:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
Web page input encoding: The font encoding entered in the input box
4. The request stream input by the web server: the request data of the corresponding browser of the web server
setCharacterEncoding:request.setCharacterEncoding(),response.setCharacterEncoding()
5. The response stream output by the web server: the output data of the corresponding browser of the web server
setContentType:response.setContentType()
The above is the detailed content of How to set encoding for jsp?. For more information, please follow other related articles on the PHP Chinese website!