<jsp-config> includes <taglib> and <jsp-property-group> two child elements.
Where the <taglib> element already exists at JSP 1.2, and <jsp-property-group> is the new element of 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 of values 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>: Set the encoding of the 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.
A simple <jsp-config> element complete configuration:
<jsp-config>
<taglib>
<taglib-uri>Taglib</taglib-uri>
<taglib-location>/WEB-INF/tlds/MyTaglib.tld</taglib-location>
</taglib>
<jsp-property-group>
<description>special Property Group for JSP Configuration JSP example.</description>
<display-name>JSPConfiguration</display-name>
<url-pattern>/jsp/* </url-pattern>
<el-ignored>true</el-ignored>
<page-encoding>UTF-8</page-encoding>
<scripting-invalid>true</scripting-invalid>
<include-prelude>/include/prelude.jspf</include-prelude>
<include-coda>/include/coda.jspf</include-coda>
</jsp-property-group>
</jsp-config>
In fact, not all of the attributes in Web. XML are used, such as the following example:
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<page-encoding>UTF-8</page-encoding>
<trim-directive-whitespaces>true</trim-directive-whitespaces>
</jsp-property-group>
</jsp-config>
tags that use JSP tags and jstl are often used in JSPs, such as <%@ page. %>, <%@ taglib ...%>, <c:foreach....%> In particular, loop labels, which produce a large number of empty lines in the HTML of the final output of the JSP, resulting in degraded performance. The most convenient workaround is to add the following settings in Web. xml
There are two ways to solve this problem
1, in Web. xml
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<trim-directive-whitespaces>true
</trim-directive-whitespaces>
</jsp-property-group>
2, add the header to each JSP file
<%@ page trimdirectivewhitespaces= "true"%>
The jsp-config of label definitions in Web-xml in Java Web