public class UrlMappingUtils extends java.lang.Object
Utility methods for working with UrlMappings
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static java.lang.String |
buildDispatchUrlForMapping(UrlMappingInfo info)Constructs the URI to forward to using the given request and UrlMappingInfo instance |
|
public static java.util.Map |
findAllParamsNotInKeys(java.util.Map params, java.util.Set keys) |
|
public static java.util.Map |
findAllParamsNotInUrlMappingKeywords(java.util.Map params)
|
|
public static java.lang.String |
forwardRequestForUrlMappingInfo(HttpServletRequest request, HttpServletResponse response, UrlMappingInfo info) |
|
public static java.lang.String |
forwardRequestForUrlMappingInfo(HttpServletRequest request, HttpServletResponse response, UrlMappingInfo info, java.util.Map model) |
|
public static java.lang.String |
forwardRequestForUrlMappingInfo(HttpServletRequest request, HttpServletResponse response, UrlMappingInfo info, java.util.Map<java.lang.String, java.lang.Object> model, boolean includeParams)Forwards a request for the given UrlMappingInfo object and model |
|
public static IncludedContent |
includeForUrl(java.lang.String includeUrl, HttpServletRequest request, HttpServletResponse response, java.util.Map model)Includes the given URL returning the resulting content as a String |
|
public static IncludedContent |
includeForUrlMappingInfo(HttpServletRequest request, HttpServletResponse response, UrlMappingInfo info, java.util.Map model)Include whatever the given UrlMappingInfo maps to within the current response |
|
public static IncludedContent |
includeForUrlMappingInfo(HttpServletRequest request, HttpServletResponse response, UrlMappingInfo info, java.util.Map model, LinkGenerator linkGenerator)Include whatever the given UrlMappingInfo maps to within the current response |
|
public static java.lang.String |
includeRequestForUrlMappingInfo(HttpServletRequest request, HttpServletResponse response, UrlMappingInfo info, java.util.Map<java.lang.String, java.lang.Object> model, boolean includeParams)Includes what the given UrlMappingInfo maps to in the response, where forwardRequestForUrlMappingInfo(HttpServletRequest, HttpServletResponse, UrlMappingInfo, Map, boolean) would forward to it. |
|
public static UrlMappingsHolder |
lookupUrlMappings(ServletContext servletContext)Looks up the UrlMappingsHolder instance |
|
public static View |
resolveView(HttpServletRequest request, UrlMappingInfo info, java.lang.String viewName, ViewResolver viewResolver)Resolves a view for the given view and UrlMappingInfo instance |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Constructs the URI to forward to using the given request and UrlMappingInfo instance
info - The UrlMappingInfo
Forwards a request for the given UrlMappingInfo object and model
request - The requestresponse - The responseinfo - The UrlMappingInfo objectmodel - The ModelincludeParams - Whether to include any request parametersIncludes the given URL returning the resulting content as a String
includeUrl - The URL to includerequest - The requestresponse - The responsemodel - The modelInclude whatever the given UrlMappingInfo maps to within the current response
request - The requestresponse - The responseinfo - The UrlMappingInfomodel - The modelInclude whatever the given UrlMappingInfo maps to within the current response
request - The requestresponse - The responseinfo - The UrlMappingInfomodel - The modellinkGenerator - allows for reverse url mappingIncludes what the given UrlMappingInfo maps to in the response, where forwardRequestForUrlMappingInfo(HttpServletRequest, HttpServletResponse, UrlMappingInfo, Map, boolean) would forward to it. A request that is itself an include cannot forward: a forward ends the response it is given, which inside an include belongs to the page that included it. The include answers with the action of the given mapping, whatever its URI would match and whatever error is being handled, and that action sees the id of the mapping. Once it returns, the page has its own controller namespace, controller, action, id, parameters, model and request attributes again, including those the given model set, and renders on as it was.
request - The requestresponse - The responseinfo - The UrlMappingInfo objectmodel - The ModelincludeParams - Whether to include any request parametersLooks up the UrlMappingsHolder instance
servletContext - The ServletContext objectResolves a view for the given view and UrlMappingInfo instance
request - The requestinfo - The infoviewName - The view nameviewResolver - The view resolver