com.taggercat.handlers
Class MultiActionNameRequestHandler

java.lang.Object
  extended by com.taggercat.handlers.AbstractRequestHandler
      extended by com.taggercat.handlers.MultiActionNameRequestHandler
All Implemented Interfaces:
com.taggercat.el.ELPropertyResolver, RequestHandler

public abstract class MultiActionNameRequestHandler
extends AbstractRequestHandler

This is a request handler to process requests that match multiple named actions and where each action name corresponds to a separate method within this handler. Whereas, with regular handlers, only a single action name typically supported.

The corresponding action method must also meet the following criteria:

  1. The action name must exactly match the method name or be annotated with @ActionMethod
  2. annotated with @ActionMethod, it also must meet the following criteria:

    1. the action name must exactly match the actionName annotation property
    2. be available for the current request method; GET or POST
    3. allow the current user access by as specified in the permission groups ( if any)
This handler is just a bit more convenient to use when handling more than one action name within a single class.

Whereas, with a direct subclass of the AbstractRequestHandler you'd need to typically with an if-then-else block on the current action name.

See Also:
Actions, URIAction
 

Constructor Summary
MultiActionNameRequestHandler()
           
 
Method Summary
 boolean isUserInPermittedActionRole(java.util.List<java.lang.String> actionRoles)
          Checks if the current request's user has access permission to the handler.
 boolean isValidRequestMethod(javax.servlet.http.HttpServletRequest request, java.lang.Boolean validOnPosts, java.lang.Boolean validOnGets)
          Request handlers can optionally specify that they are accepted on POST, and or GET request methods.
 
Methods inherited from class com.taggercat.handlers.AbstractRequestHandler
disableClientCache, getDataSourceName, getErrorException, getErrorPage, getErrorPageMethod, getErrorReason, getExplicitDataSourceName, getExplicitDSN, getMatchedPattern, getModel, getRequestController, getResponsePage, getResponsePageMethod, getSessionExpiredPage, getUserName4Log, init, isAjaxRequest, onChainCompleted, resolveProperty, serverTemporaryFile, serveTemporaryFile, service, setActionName, setErrorPage, setErrorPageMethod, setErrorPageMethodToRedirect, setExplicitDataSourceName, setExplicitDSN, setMatchedPattern, setResponsePage, setResponsePageMethod, setResponsePageMethodToRedirect, setSessionExpiredPage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiActionNameRequestHandler

public MultiActionNameRequestHandler()
Method Detail

isUserInPermittedActionRole

public boolean isUserInPermittedActionRole(java.util.List<java.lang.String> actionRoles)
Checks if the current request's user has access permission to the handler. The group names are assigned using the ActionPermission annotation. If permission group names are not specified, then everyone has permission.

Parameters:
actionRoles - the list of roles (groups) this action method is valid for
Returns:
true if the user has permission to the specific action

isValidRequestMethod

public boolean isValidRequestMethod(javax.servlet.http.HttpServletRequest request,
                                    java.lang.Boolean validOnPosts,
                                    java.lang.Boolean validOnGets)
Request handlers can optionally specify that they are accepted on POST, and or GET request methods. This method returns true if the request handler applies to the current request method.

Parameters:
request - the current request
validOnPosts - set true of this is valid on POST requests
validOnGets - set true of this is valid on GET requests
Returns:
true if the request handler applies to the current request method