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

How to set encoding for jsp?

藏色散人
Release: 2019-05-22 18:18:07
Original
5380 people have browsed it

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"%>
Copy after login

2. Web page display encoding: The encoding of the jsp output stream displayed in the browser

contentType: <%@ page contentType="text/html; charset=UTF-8"%>
Copy after login

3. HTML page charset:

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
Copy after login

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()
Copy after login

5. The response stream output by the web server: the output data of the corresponding browser of the web server

setContentType:response.setContentType()
Copy after login

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!

Related labels:
jsp
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template