DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
The request parameters are available on the ActionContext instance, which is made available via ThreadLocal.
| Code Block |
|---|
Map parameters = ActionContext.getContext().getParameters();
|
Implement
...
HttpParametersAware
Preferred
- Ensure that
servlet-configInterceptor is included in the Action's stack.The default stack already includes
servlet-config.
- Edit the Action so that it implements the ParameterAware HttpParametersAware interface.
- The ParameterAware HttpParametersAware interface expects a
setParametersmethod. You may wish to include a companiongetParametersmethod.
- The ParameterAware HttpParametersAware interface expects a
- At runtime, call
getParametersto obtain a Map an object representing the request parameters.
| Code Block |
|---|
Map parameters = this.getParameters();
|
| Info |
|---|
When the |
| Tip |
|---|
To unit test a ParameterAware Action, create your own Map with the pertinent request parameters and call |
@see see struts-default.xml
@see org.apache.struts.action2.interceptor.ParameterAware
@see and org.apache.struts.action2.interceptor.Servlet Config Interceptor