我们正在尝试使用OWASP Java Encoder Project's custom tag library在我们的应用程序中实现额外的跨站点脚本保护。在我正在处理的概念验证页面上,我遇到了如何在现有标记中使用Spring标记的问题,在本例中是e:forHtml
form:input
标记:
<form:input id="Quantity_${status.index}" path="<e:forHtml value=${myData.items[status.index].quantity} />" size="4" maxlength="4"/>
我被告知这应该没问题,但当我尝试这样做时,我得到了以下运行时错误:
org.springframework.beans.NotReadablePropertyException:
Invalid property '<e:forHtml value=1 />' of bean class [com.mystuff.MyData]:
Bean property '<e:forHtml value=1 />' is not readable or has an invalid getter method:
Does the return type of the getter match the parameter type of the setter?
有没有可能做到这一点,或者我应该用另一种方式重新实现它?
发布于 2014-12-19 04:17:11
我相信你可以通过使用一个变量来让它工作:
<c:set var="myPath"><e:forHtml value="${myData.items[status.index].quantity}" /></c:set>
<form:input id="Quantity_${status.index}" path="${myPath}" size="4"
maxlength="4"/>
但这基本上使这个问题成为Calling a custom JSP tag from JSTL tag的重复
https://stackoverflow.com/questions/27536535
复制相似问题