因为 value='<%=request.getParameter("numItems")%>' />中的单引号问题
我使用apache-tomcat 7.0 中使用会出现这种错误。
org.apache.jasper.JasperException: java.lang.IllegalArgumentException
<jsp:setProperty property="itemID" name="sale" param="itemID"/>
<%-- 上面的方法使用下面的方法会出现错误,所以尽量不要使用 : --%>
<jsp:setProperty property="numItems" name="sale"
value='<%=request.getParameter("numItems")%>' />而如果不进行修改直接使用
value="<%=request.getParameter("numItems")%>" />就会出现
Attribute value request.getParameter("numItems") is quoted with " which must be escaped when used within the value
本文详细介绍了在使用Apache Tomcat7.0部署JSP应用时,遇到单引号导致的JSP参数传递错误,并提供了解决方案。通过将参数值改为双引号或正确使用`<%=...%>`表达式,可以避免出现错误信息,确保应用正常运行。

346

被折叠的 条评论
为什么被折叠?



