다른 곳에서 잘 사용하던 소스를 Tomcat 에 올렸는데 다음과 같은 오류가 발생할 때가 있다.
java.lang.RuntimeException: org.apache.jasper.JasperException: /xxx/xxx/xxx/test.jsp (line: 43, column: 35) Attribute value params.getString("cmd1") is quoted with " which must be escaped when used within the value
소스를 한 번 볼까?
<jsp:include page="/display.do" flush="true"> <jsp:param name="cmd" value="header" /> <jsp:param name="cmd2" value="<%=params.getString("cmd")%>" /> <jsp:param name="PREVIEW" value="<%=params.getString("PREVIEW")%>" /> </jsp:include>
Solution 1.
<%=params.getString("cmd")%>
를
<%=params.getString(\"cmd\")%>
로 수정한다.
Solution 2.
conf/catalina.properties 에 다음을 설정한다.
org.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
...