KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jodd > servlet > ActionFilter


1 package jodd.servlet;
2
3 import javax.servlet.http.HttpServletRequest;
4 import javax.servlet.http.HttpServletResponse;
5
6 /**
7  * ActionFilter implementation is used by ActionController. It intercepts all
8  * actions, so filter will be called before and after the action invokation.
9  * <p>
10  *
11  * Filter also may chnage the default behaviour of the mapped action.
12  * Therefore, it may be used for managing security access in the application etc.
13  *
14  * @author Weird
15  */

16 public interface ActionFilter {
17
18     /**
19      * Called BEFORE some action is invoked. It may return <code>null</code> for letting the
20      * Controller to invoke the mapped action or it may return a forward instead of action.
21      *
22      * @param request http request
23      * @param response http response
24      * @param action action class that is going to be invoked
25      *
26      * @return null for invoking the action, otherwise the forward string
27      */

28     public String onAction(HttpServletRequest request, HttpServletResponse response, ActionServlet action);
29
30
31     /**
32      * Called AFTER some action is invoked. It may return <code>null</code> for letting the
33      * Controller to process the returned results of the action or it may return a
34      * forward string that will be override returned results.
35      *
36      * @param request http request
37      * @param response http response
38      * @param action action class that is going to be invoked
39      * @param actionResult
40      * result of invoked method
41      *
42      * @return not-null for overrinding returned action result
43      */

44     public String onAfterAction(HttpServletRequest request, HttpServletResponse response, ActionServlet action, String actionResult);
45
46 }
47
Popular Tags