|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ActionInterceptor
Interface for page flow action interceptors. These are configured in /WEB-INF/netui-config.xml like this:
<netui-config xmlns="http://beehive.apache.org/netui/2004/server/config"> ... <pageflow-action-interceptors> <global> <before-action> <action-interceptor> <interceptor-class>test.BeforeActionInterceptor1</interceptor-class> </action-interceptor> <action-interceptor> <interceptor-class>test.BeforeActionInterceptor2</interceptor-class> </action-interceptor> ... </before-action> <after-action> <action-interceptor> <interceptor-class>test.AfterActionInterceptor1</interceptor-class> </action-interceptor> <action-interceptor> <interceptor-class>test.AfterActionInterceptor2</interceptor-class> </action-interceptor> </after-action> </global> </pageflow-action-interceptors> ... </netui-config>Note that a registered ActionInterceptor is created and cached as a single instance per ServletContext. It should not hold any per-request or per-session state.
Method Summary | |
---|---|
InterceptorForward |
doIntercept(HttpServletRequest request,
HttpServletResponse response,
PageFlowController pageFlow,
InterceptorForward originalForward,
String actionName)
Called either before or after (depending on registration; see ActionInterceptor ) an action is raised on
a page flow. |
InterceptorForward |
doPostIntercept(HttpServletRequest request,
HttpServletResponse response,
PageFlowController pageFlow,
InterceptorForward originalForward,
String returningActionName)
Called when returning to the original page flow after an action interceptor had shown a nested page flow. |
void |
init(ActionInterceptorConfig config,
ServletContext servletContext)
Called when this interceptor is being initialized. |
Method Detail |
---|
void init(ActionInterceptorConfig config, ServletContext servletContext)
config
- the configuration object associated with this interceptor.servletContext
- the ServletContext for the current web application.InterceptorForward doIntercept(HttpServletRequest request, HttpServletResponse response, PageFlowController pageFlow, InterceptorForward originalForward, String actionName) throws Exception
ActionInterceptor
) an action is raised on
a page flow.
request
- the current HttpServletRequest.response
- the current HttpServletResponse.pageFlow
- the page flow on which the action is being raised.originalForward
- a wrapper for the original URI from the action that was intercepted. This value will be
null
if the interceptor was run before the action, or if the action itself returned
null
.actionName
- the name of the action being raised.
null
to allow flow to the
intended URI. If the returned InterceptorForward points to a nested page flow, then
doPostIntercept(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.beehive.netui.pageflow.PageFlowController, org.apache.beehive.netui.pageflow.interceptor.InterceptorForward, java.lang.String)
will be called before the nested page flow returns to the original page
flow.
Exception
InterceptorForward doPostIntercept(HttpServletRequest request, HttpServletResponse response, PageFlowController pageFlow, InterceptorForward originalForward, String returningActionName) throws Exception
request
- the current HttpServletRequest.response
- the current HttpServletResponse.pageFlow
- the page flow to which control is being returned.originalForward
- the forward in the original page flow that was intercepted (through #doIntercept)
to transfer control to the nested page flow. This object may be returned, in which case the
original page flow navigates to the same URI it intended to show before interception occurred.returningActionName
- the action returned by the nested page flow. If null
is returned
from this method, then that action will be raised on the original page flow.
null
if the original page flow should handle the nested return normally.
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |