Joke Collection Website - Blessing messages - Is the garbled java program related to the coding of the operating system on the server?
Is the garbled java program related to the coding of the operating system on the server?
This method is also related to the operating system. If no encoding is specified, the java program will adopt the system encoding, and it is recommended to set it to UTF-8 encoding.
Two methods to solve the garbled code:
DoGet method in 1.servlet:
string name = request . getparameter(“name“);
String name = new string (request. getparameter(“name ")). getBytes(“ISO8859- 1“),“utf-8“);
2. Use filters to solve the problem of garbled code.
Create a new filter file in the project.
Write the following code in the doFliter method:
Httpservlet requestreq = (httpservlet request) request;
3. Set the file encoding in the development tool eclipse:
1. Click the window.
2. Click Reference at the bottom of the list.
3. Click Workspace in the reference interface.
4. Click Other on the Tex file code on the right.
5. Select the corresponding code.
6. UTF 8 encoding is recommended.
- Previous article:Personal stories of epidemic prevention volunteers 2022 model essay
- Next article:How does Debon check the express delivery?
- Related articles
- Defendant, but no case was found.
- How to write an invitation letter when my daughter goes to college and invites guests to dinner?
- What does e-commerce crm system mean?
- Under what circumstances, Tencent customer service will have a text message saying that your money has been collected.
- SMS cancels domestic 5 yuan package.
- Foshan residents' electricity charge standard in 2023
- The most touching love words of past birthday wishes
- Romantic short sentence copywriting
- After I confessed to a girl, she ignored me. What happened?
- Heroes, this year's four-level inquiry, how to check by texting?