public class FormsHandlingServletHelper
extends java.lang.Object
Constructor and Description |
---|
FormsHandlingServletHelper(java.lang.String[] parameterNameWhitelist,
SaferSlingPostValidator validator,
java.util.Set<java.lang.String> formResourceTypes,
boolean allowExpressions,
FormStructureHelperFactory formStructureHelperFactory)
A helper class for handling form POSTS.
|
Modifier and Type | Method and Description |
---|---|
void |
doPost(SlingHttpServletRequest request,
SlingHttpServletResponse response)
Helper method which validates the submitted form and then forwards request to appropriate action handler.
|
void |
handleFilter(ServletRequest request,
ServletResponse response,
FilterChain chain,
java.lang.String extensionToAdd,
java.lang.String selectorToAdd)
Checks if resource in request if form type.
|
public FormsHandlingServletHelper(java.lang.String[] parameterNameWhitelist, SaferSlingPostValidator validator, java.util.Set<java.lang.String> formResourceTypes, boolean allowExpressions, FormStructureHelperFactory formStructureHelperFactory)
parameterNameWhitelist
- Parameter names that will pass request validation. A validation error will occur if
any posted parameters are not in the whitelist and not defined on the form.validator
- SaferSlingPostValidator
formResourceTypes
- sling resource types of forms which this class can handleallowExpressions
- True to evaluate expressions on form submissions.
For details see FormsHelper.allowExpressions(SlingHttpServletRequest)
formStructureHelperFactory
- Form structure helperpublic void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws java.io.IOException, ServletException
request
- SlingHttpServletRequest
response
- SlingHttpServletResponse
java.io.IOException
- if post caused an errorServletException
- if post caused an errorpublic void handleFilter(ServletRequest request, ServletResponse response, FilterChain chain, java.lang.String extensionToAdd, java.lang.String selectorToAdd) throws java.io.IOException, ServletException
request
- ServletRequest
response
- ServletResponse
chain
- FilterChain
extensionToAdd
- extension to be added to request eg. "html"selectorToAdd
- selector to be added to request.java.io.IOException
- IOException
ServletException
- ServletException
Copyright © 2010 - 2020 Adobe. All Rights Reserved