|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.taggercat.handlers.AbstractRequestHandler
com.taggercat.handlers.AbstractURIPatternHandler
public abstract class AbstractURIPatternHandler
This is a request handler to process requests that match URI Patterns. The
URI pattern is declared with named placeholders such as:
/requirements/{type}/{action}/{id}.
The placeholders are specified within the curly brace { and }
delimiters.
Unlike the AbstractURIHandler, handlers of this class are not mapped into the controller using a Reg. Expression. Subsequently, these handlers are also not mapped in using the @Actions annotation. Rather, they must be mapped in with the @URIAction annotation.
If constraints are specified on the placeholders, then the placeholder values must also match the constraints.
If the Pattern contains an {action} placeholder, and that placeholder resolves to a non empty value, then the corresponding named action method in this class will be invoked. Or the action name is being specified on a POST with a tcURIActionName parameter. The corresponding action method must also meet the following criteria:
If there is no {action} placeholder, you'll typically want to specify a defaultActionMehod in the URIAction annotation. Alternatively, you can use a tcActionName parameter to set the action name.
Otherwise, standard request handling will simply be applied to serve the current response page.
The names and matched values of the placeholder are available using getUriParameters(). If default values are specified, they are used in place of the any non matched placeholders.
URIAction
![]() |
![]() |
| Constructor Summary | |
|---|---|
AbstractURIPatternHandler()
|
|
| Method Summary | |
|---|---|
static java.lang.Object |
convertStringToType(java.lang.String value,
java.lang.Class<?> type)
Converts a string value to a primitive type value (or String). |
java.util.Map<java.lang.String,java.lang.String> |
getUriParameters()
|
URIPattern |
getUriPattern()
|
static boolean |
isPrimitiveType(java.lang.Class<?> clazz)
|
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. |
void |
setUriParameters(java.util.Map<java.lang.String,java.lang.String> uriParameters)
|
void |
setUriPattern(URIPattern uriPattern)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractURIPatternHandler()
| Method Detail |
|---|
public boolean isUserInPermittedActionRole(java.util.List<java.lang.String> actionRoles)
actionRoles - the list of roles (groups) this action method is valid for
public static java.lang.Object convertStringToType(java.lang.String value,
java.lang.Class<?> type)
value - the stringtype - the new value type
public static boolean isPrimitiveType(java.lang.Class<?> clazz)
public boolean isValidRequestMethod(javax.servlet.http.HttpServletRequest request,
java.lang.Boolean validOnPosts,
java.lang.Boolean validOnGets)
request - the current requestvalidOnPosts - set true of this is valid on POST requestsvalidOnGets - set true of this is valid on GET requests
public java.util.Map<java.lang.String,java.lang.String> getUriParameters()
public void setUriParameters(java.util.Map<java.lang.String,java.lang.String> uriParameters)
public URIPattern getUriPattern()
public void setUriPattern(URIPattern uriPattern)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||