读书人

Tomcat双引号改单引号有关问题

发布时间: 2012-10-07 17:28:51 作者: rapoo

Tomcat双引号改单引号问题

在如下调用时出错:????

<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.

?

读书人网 >编程

热点推荐