public class FormsHandlingServletHelper extends Object
| Constructor and Description |
|---|
FormsHandlingServletHelper(String[] parameterNameWhitelist,
SaferSlingPostValidator validator,
Set<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,
String extensionToAdd,
String selectorToAdd)
Checks if resource in request if form type.
|
public FormsHandlingServletHelper(String[] parameterNameWhitelist, SaferSlingPostValidator validator, Set<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 - SaferSlingPostValidatorformResourceTypes - 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 IOException, ServletException
request - SlingHttpServletRequestresponse - SlingHttpServletResponseIOException - if post caused an errorServletException - if post caused an errorpublic void handleFilter(ServletRequest request, ServletResponse response, FilterChain chain, String extensionToAdd, String selectorToAdd) throws IOException, ServletException
request - ServletRequestresponse - ServletResponsechain - FilterChainextensionToAdd - extension to be added to request eg. "html"selectorToAdd - selector to be added to request.IOException - IOExceptionServletException - ServletExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved