public class JSONValidationInterceptor extends MethodFilterInterceptor
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ENCODING |
static String |
NO_ENCODING_SET_PARAM |
static String |
VALIDATE_JSON_PARAM |
static String |
VALIDATE_ONLY_PARAM |
excludeMethods, includeMethods
Constructor and Description |
---|
JSONValidationInterceptor() |
Modifier and Type | Method and Description |
---|---|
protected String |
buildResponse(ValidationAware validationAware) |
protected String |
doIntercept(ActionInvocation invocation) |
boolean |
isJsonEnabled(javax.servlet.http.HttpServletRequest request) |
boolean |
isSetEncoding(javax.servlet.http.HttpServletRequest request) |
boolean |
isValidateOnly(javax.servlet.http.HttpServletRequest request) |
void |
setNoEncodingSetParam(String noEncodingSetParam)
Overrides 'struts.JSONValidation.no.encoding' param name
|
void |
setValidateJsonParam(String validateJsonParam)
Overrides 'struts.enableJSONValidation' param name
|
void |
setValidateOnlyParam(String validateOnlyParam)
Overrides 'struts.validateOnly' param name
|
void |
setValidationFailedStatus(int validationFailedStatus)
HTTP status that will be set in the response if validation fails
|
applyInterceptor, getExcludeMethodsSet, getIncludeMethodsSet, intercept, setExcludeMethods, setIncludeMethods
destroy, init
public static final String VALIDATE_ONLY_PARAM
public static final String VALIDATE_JSON_PARAM
public static final String NO_ENCODING_SET_PARAM
public static final String DEFAULT_ENCODING
protected String doIntercept(ActionInvocation invocation) throws Exception
doIntercept
in class MethodFilterInterceptor
Exception
public boolean isJsonEnabled(javax.servlet.http.HttpServletRequest request)
public boolean isValidateOnly(javax.servlet.http.HttpServletRequest request)
public boolean isSetEncoding(javax.servlet.http.HttpServletRequest request)
protected String buildResponse(ValidationAware validationAware)
validationAware
- the validation aware objectpublic void setValidationFailedStatus(int validationFailedStatus)
validationFailedStatus
- validation failed statuspublic void setValidateOnlyParam(String validateOnlyParam)
validateOnlyParam
- new param namepublic void setValidateJsonParam(String validateJsonParam)
validateJsonParam
- new param namepublic void setNoEncodingSetParam(String noEncodingSetParam)
noEncodingSetParam
- new param nameCopyright © 2000–2020 Apache Software Foundation. All rights reserved.