velosurf.validation
Class ValidationFilter
java.lang.Object
velosurf.validation.ValidationFilter
- All Implemented Interfaces:
- javax.servlet.Filter
public class ValidationFilter
- extends java.lang.Object
- implements javax.servlet.Filter
This class is an optional filter that will validate query data according to the "velosurf.entity" query parameter
(may be multivalued).
If data pass all validation constraints, the filter will let the request pass towards the form action. Otherwise,
it will redirect back the user to the original form (using the referer query header). In this case, the filter will
populate the session with the given values (escaped) so that they can be put in the form.
// TODO example
|
Field Summary |
private javax.servlet.FilterConfig |
config
|
private static java.lang.String |
ENTITY_KEY
|
|
Method Summary |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
|
void |
init(javax.servlet.FilterConfig filterConfig)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
config
private javax.servlet.FilterConfig config
ENTITY_KEY
private static final java.lang.String ENTITY_KEY
- See Also:
- Constant Field Values
ValidationFilter
public ValidationFilter()
init
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
- Specified by:
init in interface javax.servlet.Filter
- Throws:
javax.servlet.ServletException
doFilter
public void doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
throws java.io.IOException,
javax.servlet.ServletException
- Specified by:
doFilter in interface javax.servlet.Filter
- Throws:
java.io.IOException
javax.servlet.ServletException
destroy
public void destroy()
- Specified by:
destroy in interface javax.servlet.Filter
~ooOoo~