<bean:message key="unite.error.format" arg0="<%=Utility.getMessage("backend.livemanager.itemindex")%>"/>

最近发现tomcat 5.5.27和6.0.18都不能正确的解析上面的这段JSP代码了。说是Utility.getMessage("backend.livemanager.itemindex")这段要escape一下~~~~无语

Then I found that the JSP 2.0 standard states that quotes in JSP espressions used in tag attributes must be escaped with a backslash. This is silly, unnecessary and counter-intuitive but it is the standard...

F*cking the silly tomcat~~~~

解决的办法是在${tomcat}/conf下面的catalina.properties中加入以下内容:

org.apache.jasper.compiler. Parser.STRICT_QUOTE_ESCAPING=false

这样就关闭了这个令人讨厌的引号escape验证。

当然对于最新的jsp/servlet标准而言,上面提到的写法确实已经不合法了。所以建议以后可以用<bean:message key="unite.error.format" arg0="<%=Utility.getMessage(\”backend.livemanager.itemindex\”)%>"/>

代替。


文章来源:http://x-spirit.spaces.live.com/Blog/cns!CC0B04AE126337C0!562.entry