JSP in the use of Jstl to import HTML garbled problem solving method _jsp programming

Source: Internet
Author: User

Garbled behavior occurs when importing HTML through JST <c:import> in a JSP, because Org.apache.taglibs.standard.tag.common.core.ImportSupport

Charencoding value is null, charencoding is the default value, which is iso-8859-1

Fortunately, charencoding can be set directly through <c:import>, so just set it up, and many people say it can be done through meta settings in HTML, but I've tried it contenttype Also by looking at the source of the JSTL can be set up this, because it is usually used Cimport import jsp,jsp set is feasible, but the static page is not. Here's the main code for Importsupport:

Copy Code code as follows:

Reader r = null;
String CharSet;
String CharSet;
if ((this.charencoding!= null) && (!this.charencoding.equals (""))) {
CharSet = this.charencoding;
}
else {
String ContentType = Uc.getcontenttype ();
if (ContentType!= null) {
String CharSet = Util.getcontenttypeattribute (ContentType, "CharSet");
if (CharSet = = null) CharSet = "Iso-8859-1";
}
else {
CharSet = "Iso-8859-1";
}
}

Related Article

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.