2016-08-01 111 views
1

我正在使用Struts 1和JSP开发应用程序。我必须写XSS保护。我投入像这样的:Bean:写入过滤器不起作用

<input id="name" name="name" class="someClass" type="text" 
     value="<bean:write name="personForm" property="name"/>"> 

,我读了保护XSS攻击我一定要在绿豆加属性过滤器:编写和过滤器应该是真实的。所以我现在的代码看起来像是

<input id="name" name="name" class="someClass" type="text" 
     value="<bean:write name="personForm" property="name" filter="true"/>"> 

但是我仍然可以提交脚本。你知道为什么会发生这种情况吗?

回答

1

bean:write仅用于渲染目的。传递给服务器端的值不会被过滤。