public class StaticParametersInterceptor extends AbstractInterceptor
Parameterizable
, a map of the static parameters will be also be passed directly to the action.
The static params will be added to the request params map, unless "merge" is set to false.
Parameters are typically defined with <param> elements within xwork.xml.
Interceptor parameters:
Extending the interceptor:
There are no extension points to this interceptor.
Example code:
<action name="someAction" class="com.examples.SomeAction"> <interceptor-ref name="staticParams"> <param name="parse">true</param> <param name="overwrite">false</param> </interceptor-ref> <result name="success">good_result.ftl</result> </action>
Constructor and Description |
---|
StaticParametersInterceptor() |
Modifier and Type | Method and Description |
---|---|
protected void |
addParametersToContext(ActionContext ac,
Map<String,?> newParams)
Adds the parameters into context's ParameterMap.
|
String |
intercept(ActionInvocation invocation)
Override to handle interception
|
protected Map<String,String> |
retrieveParameters(ActionContext ac) |
void |
setDevMode(String mode) |
void |
setLocalizedTextProvider(LocalizedTextProvider localizedTextProvider) |
void |
setMerge(String value) |
void |
setOverwrite(String value)
Overwrites already existing parameters from other sources.
|
void |
setParse(String value) |
void |
setValueStackFactory(ValueStackFactory valueStackFactory) |
destroy, init
public void setValueStackFactory(ValueStackFactory valueStackFactory)
public void setDevMode(String mode)
public void setLocalizedTextProvider(LocalizedTextProvider localizedTextProvider)
public void setParse(String value)
public void setMerge(String value)
public void setOverwrite(String value)
value
- enable overwrites of already existing parameters from other sourcespublic String intercept(ActionInvocation invocation) throws Exception
AbstractInterceptor
intercept
in interface Interceptor
intercept
in class AbstractInterceptor
invocation
- the action invocationActionInvocation.invoke()
, or from the interceptor itself.Exception
- any system-level error, as defined in Action.execute()
.protected Map<String,String> retrieveParameters(ActionContext ac)
ac
- The action contextprotected void addParametersToContext(ActionContext ac, Map<String,?> newParams)
ac
- The action contextnewParams
- The parameter map to applyCopyright © 2000–2020 Apache Software Foundation. All rights reserved.