在
<init-param>为
JspServlet需要走在
web.xml了的 servletcontainer
本身,而不是你的web应用。转到Tomcat安装文件夹并打开
/conf/web.xml文件。找到
<servlet>的进入
JspServlet,并添加
<init-param>那里。
例如,如果您想在
web.xmlwebapp的全局配置中进行配置,例如因为servletcontainer配置不在您的控制范围内,那么您需要设置的
<trim-directive-whitespaces>属性
<jsp-config>。
<jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <trim-directive-whitespaces>true</trim-directive-whitespaces> </jsp-property-group></jsp-config>



