<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