public class ScopeInterceptor extends AbstractInterceptor implements PreResultListener
PreResultListener), rather than after action is invoked. There is a reason for that: At this moment we know that
action's state is "complete" as it's values may depend on the rest of the stack and specifically - on the values of
nested interceptors.
Interceptor parameters:
<!-- As the filter and orderBy parameters are common for all my browse-type actions,
you can move control to the scope interceptor. In the session parameter you can list
action properties that are going to be automatically managed over session. You can
do the same for application-scoped variables-->
<action name="someAction" class="com.examples.SomeAction">
<interceptor-ref name="basicStack"/>
<interceptor-ref name="hibernate"/>
<interceptor-ref name="scope">
<param name="session">filter,orderBy</param>
<param name="autoCreateSession">true</param>
</interceptor-ref>
<result name="success">good_result.ftl</result>
</action>
| Constructor and Description |
|---|
ScopeInterceptor()
The constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
after(ActionInvocation invocation,
String result) |
protected void |
before(ActionInvocation invocation) |
void |
beforeResult(ActionInvocation invocation,
String resultCode) |
String |
getSessionReset() |
String |
getType() |
String |
intercept(ActionInvocation invocation) |
boolean |
isReset() |
void |
setApplication(String s)
Sets a list of application scoped properties
|
void |
setAutoCreateSession(String value)
Sets if the session should be automatically created
|
void |
setKey(String key) |
void |
setReset(boolean reset) |
void |
setSession(String s)
Sets a list of session scoped properties
|
void |
setSessionReset(String sessionReset) |
void |
setType(String type)
Sets the type of scope operation
|
destroy, initpublic void setApplication(String s)
s - A comma-delimited listpublic void setSession(String s)
s - A comma-delimited listpublic void setAutoCreateSession(String value)
value - True if it should be createdprotected void after(ActionInvocation invocation, String result) throws Exception
Exceptionprotected void before(ActionInvocation invocation) throws Exception
Exceptionpublic void setKey(String key)
public void beforeResult(ActionInvocation invocation, String resultCode)
beforeResult in interface PreResultListenerpublic String getType()
public void setType(String type)
type - Either "start" or "end"public String getSessionReset()
public void setSessionReset(String sessionReset)
sessionReset - The session reset parameter namepublic String intercept(ActionInvocation invocation) throws Exception
intercept in interface Interceptorintercept in class AbstractInterceptorExceptionpublic boolean isReset()
public void setReset(boolean reset)
reset - True if the scope should be resetCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.