在如下调用时出错:
<jsp:include page="test.jsp">
<jsp:param name="returl" value="<%=Url.encode(****) %>" />
</jsp:include>
这里,在 value 中只是使用了 URL 而已。
然后报错:
Attribute value Url.encode(****) is quoted with " which must be escaped when used within the value
解决:
1、把 value="" 改成 value=''.
2、修改Tomcat目录:D:\Java\tomcat-6.0.20\conf下面的catalina.properties文件,在最后面加入:
org.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false.
具体见官方
写道
可以通过设置System Properties来改变tomcat的默认行为:
org.apache.jasper.compiler. Parser.STRICT_QUOTE_ESCAPING
If false the requirements for escpaing quotes in JSP attributes will be relaxed so that a missing required quote will not cause an error. If not specified, the specification compliant default of true will be used.
org.apache.jasper.compiler. Parser.STRICT_QUOTE_ESCAPING
If false the requirements for escpaing quotes in JSP attributes will be relaxed so that a missing required quote will not cause an error. If not specified, the specification compliant default of true will be used.