|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bowstreet.webapp.util.URLMappingUtils
public class URLMappingUtils
Static URL Mapping convenience methods for use in extraordinary circumstances when the recommended WebAppAccess URL Mapping APIs do not provide what is necessary for custom (non default) URL mapping.
Typically, WebApp developers should use the URL mapping APIs documented in WebAppAccess and URLMapper classes, rather than these specialized utility routines described below. This class is provided only for those circumstances when the recommended APIs do not provide what is necessary for custom URLMapper implementation/use and swapping in a custom URL mapper for a particular request or session.
Wraps complexity of pluggable URLMapper implementations
Field Summary | |
---|---|
static java.lang.String |
BASE_URLMAPPER_TOKEN
Request attribute holding instance of the "base" URLMapper: the first one associated with this request. |
static java.lang.String |
DEFAULT_URL_MAPPER
Default URL Mapper class / implementation. |
static java.lang.String |
URLMAPPER_TOKEN
Token specifying current URLMapper, as a request attribute |
Constructor Summary | |
---|---|
URLMappingUtils()
|
Method Summary | |
---|---|
static java.lang.String |
getURL(WebAppAccess app,
java.lang.String actionName,
java.lang.String profileName,
java.lang.String httpChoice)
getURL for the model running in this server/app-context. |
static java.lang.String |
getURL(WebAppAccess app,
java.lang.String modelName,
java.lang.String actionName,
java.lang.String profileName,
java.lang.String httpChoice)
getURL for a model running in this server/app-context |
static URLMapper |
getURLMapper(javax.servlet.http.HttpServletRequest req)
Get a reference to the URLMapper for this request |
static URLMapper |
setURLMapper(javax.servlet.http.HttpServletRequest req,
java.lang.String classname)
Set URLMapper for this request, by classname. |
static void |
setURLMapperForSession(javax.servlet.http.HttpServletRequest req,
java.lang.String classname)
Set URLMapper for the specified session, by classname Allows you to override the default URL mapper for this request, with an alternate custom URL mapper. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BASE_URLMAPPER_TOKEN
public static java.lang.String DEFAULT_URL_MAPPER
public static final java.lang.String URLMAPPER_TOKEN
Constructor Detail |
---|
public URLMappingUtils()
Method Detail |
---|
public static java.lang.String getURL(WebAppAccess app, java.lang.String actionName, java.lang.String profileName, java.lang.String httpChoice)
app
- web app request context for access to servlet reqactionName
- action name (or null to default to "main")profileName
- profile name (or null for no explicit profile)httpChoice
- should contain one of: "http:" "https:" or null
public static java.lang.String getURL(WebAppAccess app, java.lang.String modelName, java.lang.String actionName, java.lang.String profileName, java.lang.String httpChoice)
app
- web app request context for access to servlet reqmodelName
- model name (null default = the model described by app)actionName
- action name (or null to default to "main")profileName
- profile name (or null for no explicit profile)httpChoice
- should contain one of: "http:" "https:" or null
public static URLMapper getURLMapper(javax.servlet.http.HttpServletRequest req)
req
- current request object.
public static URLMapper setURLMapper(javax.servlet.http.HttpServletRequest req, java.lang.String classname) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
req
- requestclassname
- representation of the custom URL mapper class
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public static void setURLMapperForSession(javax.servlet.http.HttpServletRequest req, java.lang.String classname) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
req
- current request object.classname
- representation of the custom URL mapper class.
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |