在Spring中,你可以从
<form>标记生成的JSP页面中转义html 。这为XSS攻击提供了很多途径,并且可以通过以下三种方式自动完成:
对于
web.xml文件中的整个应用程序:
<context-param> <param-name>defaultHtmlEscape</param-name> <param-value>true</param-value></context-param>
对于文件本身中给定页面上的所有表单:
<spring:htmlEscape defaultHtmlEscape="true" />
对于每种形式:
<form:input path="someFormField" htmlEscape="true" />



