Problem?
When you use <jsp:include page= "top.html" ></jsp:include> introduce HTML files,
and the JSP and HTML encoding are utf-8, but there will be garbled,
is to automatically encode HTML when using <jsp:include.
And this code is the system default GBK so at this time and their own code conflicts will appear garbled,
Let's take a look at the configuration of Jsp-config in Web. xml
<jsp-config> includes <taglib> and <jsp-property-group> two child elements.
where the <taglib> element already exists at JSP 1.2;
<jsp-property-group> is the new element in JSP 2.0.
The <jsp-property-group> element consists of eight sub-elements, each of which are:
1.<description>: Description of the setting
2.<display-name>: Set name
3.<URL-PATTERN>: The range affected by the setpoint, such as:/ch2 or/*.jsp
4.<el-ignored>: True to indicate that El syntax is not supported
5.<scripting-invalid>: True to indicate that <% scripting%> syntax is not supported
6.<PAGE-ENCODING>: Setting the encoding of a JSP Web page
7.<include-prelude>: Sets the header of the JSP Web page with the extension. JSPF
8.<INCLUDE-CODA>: Sets the end of the JSP Web page with the extension. JSPF
Answer:
The workaround is to add the following code in Web. XML:
<Jsp-config> <Jsp-property-group> <Description>Special Property Group for JSP Configuration HTML example. </Description> <Display-name>Jspconfiguration</Display-name> <Url-pattern>*.html</Url-pattern> <el-ignored>True</el-ignored> <page-encoding>UTF-8</page-encoding> <Scripting-invalid>False</Scripting-invalid> <Include-prelude></Include-prelude> <Include-coda></Include-coda> </Jsp-property-group> </Jsp-config>
JSP include HTML garbled problem solved