Home » xwork-2.1.5 » com.opensymphony » xwork2 » interceptor » [javadoc | source]
com.opensymphony.xwork2.interceptor
public class: StaticParametersInterceptor [javadoc | source]
java.lang.Object
   com.opensymphony.xwork2.interceptor.AbstractInterceptor
      com.opensymphony.xwork2.interceptor.StaticParametersInterceptor

All Implemented Interfaces:
    Interceptor

This interceptor populates the action with the static parameters defined in the action configuration. If the action implements 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>

Field Summary
static  boolean devMode     
Method from com.opensymphony.xwork2.interceptor.StaticParametersInterceptor Summary:
addParametersToContext,   intercept,   retrieveParameters,   setDevMode,   setMerge,   setOverwrite,   setParse,   setValueStackFactory
Methods from com.opensymphony.xwork2.interceptor.AbstractInterceptor:
destroy,   init,   intercept
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.opensymphony.xwork2.interceptor.StaticParametersInterceptor Detail:
 protected  void addParametersToContext(ActionContext ac,
    Map<String, ?> newParams) 
    Adds the parameters into context's ParameterMap. As default, static parameters will not overwrite existing paramaters from other sources. If you want the static parameters as successor over already existing parameters, set overwrite to true.
 public String intercept(ActionInvocation invocation) throws Exception 
 protected Map<String, String> retrieveParameters(ActionContext ac) 
 public static  void setDevMode(String mode) 
 public  void setMerge(String value) 
 public  void setOverwrite(String value) 
    Overwrites already existing parameters from other sources. Static parameters are the successor over previously set parameters, if true.
 public  void setParse(String value) 
 public  void setValueStackFactory(ValueStackFactory valueStackFactory)