Spring / Spring Interview questions II
How do I prevent XSS attack at JSP HTML form?
There are three easy ways.
To implement the HTML escape at the entire application level, add the following at the web.xml.
<context-param> <param-name>defaultHtmlEscape</param-name> <param-value>true</param-value> </context-param>
For all forms on a given JSP page,
<spring:htmlEscape defaultHtmlEscape="true" />
For each form:
<form:input path="formFieldName" htmlEscape="true" />
More Related questions...