."/> .">

Home  >  Article  >  Java  >  How to set encoding for jsp?

How to set encoding for jsp?

藏色散人
藏色散人Original
2019-05-22 18:18:075363browse

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. .

How to set encoding for jsp?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn