类 AbstractUrlViewController
- java.lang.Object
- org.springframework.context.support.ApplicationObjectSupport
- org.springframework.web.context.support.WebApplicationObjectSupport
- org.springframework.web.servlet.support.WebContentGenerator
- org.springframework.web.servlet.mvc.AbstractController
- org.springframework.web.servlet.mvc.AbstractUrlViewController
- 所有已实现的接口:
Aware
,ApplicationContextAware
,ServletContextAware
,Controller
- 直接已知子类:
UrlFilenameViewController
public abstract class AbstractUrlViewController extends AbstractController
Abstract base class forControllers
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
andurlDecode
properties.- 从以下版本开始:
- 1.2.6
- 作者:
- Juergen Hoeller
- 另请参阅:
setAlwaysUseFullPath(boolean)
,setUrlDecode(boolean)
字段概要
从类继承的字段 org.springframework.web.servlet.support.WebContentGenerator
HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
从类继承的字段 org.springframework.context.support.ApplicationObjectSupport
logger
构造器概要
构造器 构造器 说明 AbstractUrlViewController()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 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 togetViewNameForRequest(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.从类继承的方法 org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
从类继承的方法 org.springframework.web.servlet.support.WebContentGenerator
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
从类继承的方法 org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
从类继承的方法 org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
构造器详细资料
AbstractUrlViewController
public AbstractUrlViewController()
方法详细资料
setAlwaysUseFullPath
public void setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use full path within current servlet context. Else, the path within the current servlet mapping is used if applicable (i.e. in the case of a ".../*" servlet mapping in web.xml). Default is "false".
setUrlDecode
public void setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded. Both are returned undecoded by the Servlet API, in contrast to the servlet path.Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).
setRemoveSemicolonContent
public void setRemoveSemicolonContent(boolean removeSemicolonContent)
Set if ";" (semicolon) content should be stripped from the request URI.
setUrlPathHelper
public void setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for the resolution of lookup paths.Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple MethodNameResolvers and HandlerMappings.
getUrlPathHelper
protected UrlPathHelper getUrlPathHelper()
Return the UrlPathHelper to use for the resolution of lookup paths.
handleRequestInternal
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
Retrieves the URL path to use for lookup and delegates togetViewNameForRequest(javax.servlet.http.HttpServletRequest)
. Also adds the content ofRequestContextUtils.getInputFlashMap(javax.servlet.http.HttpServletRequest)
to the model.
getViewNameForRequest
protected abstract String getViewNameForRequest(HttpServletRequest request)
Return the name of the view to render for this request, based on the given lookup path. Called byhandleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
.- 参数:
request
- current HTTP request- 返回:
- a view name for this request (never
null
) - 另请参阅:
handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
,setAlwaysUseFullPath(boolean)
,setUrlDecode(boolean)