JSP garbled problem when introducing HTML with include directive

Source: Internet
Author: User

Problems when introducing HTML files with the include directive in JSPs:

JSP and HTML can be correctly displayed, when the JSP introduced HTML Access JSP page HTML garbled, JSP original output no garbled, solution:

In the first line of HTML join: <%@ page language= "java" import= "java.util.*" pageencoding= "GB18030"%>

The encoding format for the JSP is: <%@ page language= "java" import= "java.util.*" contenttype= "Text/html;charset=utf-8" pageencoding= " UTF-8 "%>

Problem solved, as for why still in the thinking ...

The solution to the problem of converting HTML pages to JSP pages is garbled:

Suppose the original HTML code is UTF-8

Add at top of HTML

<%@ page pageencoding= "Utf-8"%>

And then modify the suffix to. JSP, that is, modify the encoding format before converting to a JSP file

JSP garbled problem when introducing HTML with include directive

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.