public abstract class AbstractUrlViewController extends AbstractController
Controllers
that return a view name
based on the request URL.
Provides infrastructure for determining view names from URLs and configurable
URL lookup. For information on the latter, see alwaysUseFullPath
and urlDecode
properties.
setAlwaysUseFullPath(boolean)
,
setUrlDecode(boolean)
HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
logger
Constructor and Description |
---|
AbstractUrlViewController() |
Modifier and Type | Method and Description |
---|---|
protected UrlPathHelper |
getUrlPathHelper()
Return the UrlPathHelper to use for the resolution of lookup paths.
|
protected abstract String |
getViewNameForRequest(HttpServletRequest request)
Return the name of the view to render for this request, based on the
given lookup path.
|
protected ModelAndView |
handleRequestInternal(HttpServletRequest request,
HttpServletResponse response)
Retrieves the URL path to use for lookup and delegates to
getViewNameForRequest(javax.servlet.http.HttpServletRequest) . |
void |
setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use full path within current servlet
context.
|
void |
setRemoveSemicolonContent(boolean removeSemicolonContent)
Set if ";" (semicolon) content should be stripped from the request URI.
|
void |
setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded.
|
void |
setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for the resolution of lookup paths.
|
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
applyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader, setVaryByRequestHeaders
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
public void setAlwaysUseFullPath(boolean alwaysUseFullPath)
public void setUrlDecode(boolean urlDecode)
Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).
UrlPathHelper.setUrlDecode(boolean)
public void setRemoveSemicolonContent(boolean removeSemicolonContent)
public void setUrlPathHelper(UrlPathHelper urlPathHelper)
Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple MethodNameResolvers and HandlerMappings.
protected UrlPathHelper getUrlPathHelper()
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
getViewNameForRequest(javax.servlet.http.HttpServletRequest)
. Also adds the content of
RequestContextUtils.getInputFlashMap(javax.servlet.http.HttpServletRequest)
to the model.protected abstract String getViewNameForRequest(HttpServletRequest request)
handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
.request
- current HTTP requestnull
)handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
,
setAlwaysUseFullPath(boolean)
,
setUrlDecode(boolean)