Home > Java > JavaBase > body text

Solution to garbled code in java jsp page

Release: 2019-12-05 11:38:19
Original
2341 people have browsed it

Solution to garbled code in java jsp page

garbled characters appear on the jsp page: (Recommended: java video tutorial)

Question: Developers developing jsp should have good coding awareness, jsp The top should first clarify what the encoding is?

Solution: Add the following statement at the top of the page

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
Copy after login

Html Chinese garbled code:

Problem: The main reason for garbled code in htmll is that the Chinese text content in the html source code is inconsistent with Caused by different html encoding. The encoding of the web page is gbk, while the Chinese one is utf-8;

Solution: Add the following code to the top of the page......

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

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

The above is the detailed content of Solution to garbled code in java jsp page. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!