Home > Java > JavaBase > How to solve java servlet garbled characters

How to solve java servlet garbled characters

Release: 2019-11-21 17:04:18
Original
2391 people have browsed it

How to solve java servlet garbled characters

Java Servlet is a program that runs on a Web server or application server. It serves as a link between a request from a Web browser or other HTTP client and a database or application on the HTTP server. middle layer.

Using Servlets, you can collect user input from web forms, render records from databases or other sources, and dynamically create web pages.

Servlet garbled solution:

1) Encode the received content (parameters)

request.setCharacterEncodeing(String charset);
Copy after login

2) Encode the forwarded content to be output

response.setContextType("text/html;charset=utf-8");
Copy after login

For more java knowledge, please pay attention to java basic tutorial.

The above is the detailed content of How to solve java servlet garbled characters. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
Latest Issues
Install JAVA
From 1970-01-01 08:00:00
0
0
0
Unable to install java
From 1970-01-01 08:00:00
0
0
0
Can java be used as the backend of the web?
From 1970-01-01 08:00:00
0
0
0
Is this in Java language?
From 1970-01-01 08:00:00
0
0
0
Help: JAVA encrypted data PHP decryption
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template