1. 程式人生 > >Attribute value ("XXX") is quoted with " which must be escaped when used within the value 異常的修正1

Attribute value ("XXX") is quoted with " which must be escaped when used within the value 異常的修正1

 此問題是由於tomcat5.5.28及以上版本升級引起。


1.       可以修改程式碼如下:

<jsp:include page="fastpost.jsp">
    <jsp:param name="returl" value='<%=Url.encode(“***”) %>' />
</jsp:include>

類似比如<input type="text" value='<%=request.getParameter("username")%>'這樣。


2.       可以在catalina.sh中加入

JAVA_OPTS="-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"


3.       或者可以在Tomcat的Java Options中加入

-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false

如圖所示: