public class ActionMappingParametersInteceptor extends ParametersInterceptor
ParametersInterceptor
, only the parameters come from the ActionMapping
, not the
ActionContext.getParameters()
method.
Interceptor parameters:
ParameterNameAware
interface in your
actions. However, if you wish to apply a global rule that isn't implemented in your action, then you could extend
this interceptor and override the ParametersInterceptor.acceptableName(String)
method.
Example code:
<action name="someAction" class="com.examples.SomeAction"> <interceptor-ref name="mappingParams"/> <result name="success">good_result.ftl</result> </action>
ACCEPTED_PARAM_NAMES, acceptParams, excludeParams, ordered, PARAM_NAME_MAX_LENGTH
excludeMethods, includeMethods, log
Constructor and Description |
---|
ActionMappingParametersInteceptor() |
Modifier and Type | Method and Description |
---|---|
protected void |
addParametersToContext(ActionContext ac,
Map newParams)
Adds the parameters into context's ParameterMap
|
protected Map<String,Object> |
retrieveParameters(ActionContext ac) |
acceptableName, doIntercept, getExcludeParamsSet, getOrderedComparator, getParameterLogMap, isAcceptableParameter, isAccepted, isExcluded, isOrdered, isWithinLengthLimit, notifyDeveloper, setAcceptParamNames, setDevMode, setExcludeParams, setOrdered, setParameters, setParamNameMaxLength, setValueStackFactory
applyInterceptor, getExcludeMethodsSet, getIncludeMethodsSet, intercept, setExcludeMethods, setIncludeMethods
destroy, init
protected Map<String,Object> retrieveParameters(ActionContext ac)
retrieveParameters
in class ParametersInterceptor
ac
- The action contextprotected void addParametersToContext(ActionContext ac, Map newParams)
addParametersToContext
in class ParametersInterceptor
ac
- The action contextnewParams
- The parameter map to apply
In this class this is a no-op, since the parameters were fetched from the same location.
In subclasses both retrieveParameters() and addParametersToContext() should be overridden.Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.