View Javadoc

1   package net.trajano.twiff;
2   
3   import javax.servlet.http.HttpServletRequest;
4   
5   /***
6    * Processes an action result.
7    * 
8    * @author Archimedes Trajano
9    */
10  public interface ActionResultProcessor {
11      /***
12       * Returns true if the result object is processable by the current
13       * processor.
14       * 
15       * @param result
16       *                   result of the action.
17       * @param request
18       *                   servlet request.
19       * @return true if the result is processable.
20       */
21      boolean isResultProcessable(Object result, HttpServletRequest request);
22  
23      /***
24       * Processes the action result and returns the URL to redirect to.
25       * 
26       * @param result
27       *                   result of the action.
28       * @param request
29       *                   request object.
30       * @return the redirect URL that would be encoded.
31       */
32      String processActionResult(Object result, HttpServletRequest request);
33  }