|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork.interceptor.ParameterFilterInterceptor
The Parameter Filter Interceptor blocks parameters from getting to the rest of the stack or your action. You can use multiple parameter filter interceptors for a given action, so, for example, you could use one in your default stack that filtered parameters you wanted blocked from every action and those you wanted blocked from an individual action you could add an additional interceptor for each action.
The way parameters are filtered for the least configuration is that if a string is in the allowed or blocked lists, then any parameter that is a member of the object represented by the parameter is allowed or blocked respectively.
For example, if the parameters are:
Constructor Summary | |
ParameterFilterInterceptor()
|
Method Summary | |
void |
destroy()
Called to let an interceptor clean up any resources it has allocated. |
Collection |
getAllowedCollection()
|
Collection |
getBlockedCollection()
|
void |
init()
Called after an interceptor is created, but before any requests are processed using intercept , giving
the Interceptor a chance to initialize any needed resources. |
String |
intercept(ActionInvocation invocation)
Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the request by the ActionInvocation or to short-circuit the processing and just return a String return code. |
boolean |
isDefaultBlock()
|
void |
setAllowed(String allowed)
|
void |
setAllowedCollection(Collection allowed)
|
void |
setBlocked(String blocked)
|
void |
setBlockedCollection(Collection blocked)
|
void |
setDefaultBlock(boolean defaultExclude)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ParameterFilterInterceptor()
Method Detail |
public void destroy()
Interceptor
destroy
in interface Interceptor
public void init()
Interceptor
intercept
, giving
the Interceptor a chance to initialize any needed resources.
init
in interface Interceptor
public String intercept(ActionInvocation invocation) throws Exception
Interceptor
ActionInvocation
or to short-circuit the processing and just return a String return code.
intercept
in interface Interceptor
ActionInvocation.invoke()
, or from the interceptor itself.
Exception
- any system-level error, as defined in Action.execute()
.public boolean isDefaultBlock()
public void setDefaultBlock(boolean defaultExclude)
defaultExclude
- The defaultExclude to set.public Collection getBlockedCollection()
public void setBlockedCollection(Collection blocked)
blocked
- The blocked to set.public void setBlocked(String blocked)
blocked
- The blocked paramters as comma separated String.public Collection getAllowedCollection()
public void setAllowedCollection(Collection allowed)
allowed
- The allowed to set.public void setAllowed(String allowed)
allowed
- The allowed paramters as comma separated String.
|
XWork Project Page | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |