Class ParameterizableViewController
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.ParameterizableViewController
- All Implemented Interfaces:
- Aware,- ApplicationContextAware,- ServletContextAware,- Controller
Trivial controller that always returns a pre-configured view and optionally
 sets the response status code. The view and status can be configured using
 the provided configuration properties.
- Author:
- Rod Johnson, Juergen Hoeller, Keith Donald, Rossen Stoyanchev
- 
Field SummaryFields inherited from class org.springframework.web.servlet.support.WebContentGeneratorHEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POSTFields inherited from class org.springframework.context.support.ApplicationObjectSupportlogger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturn the configured HTTP status code ornull.getView()Return the View object, ornullif we are using a view name to be resolved by the DispatcherServlet via a ViewResolver.Return the name of the view to delegate to, ornullif using a View instance.protected ModelAndViewhandleRequestInternal(HttpServletRequest request, HttpServletResponse response) Return a ModelAndView object with the specified view name.booleanWhether the request is fully handled within the controller.voidsetStatusCode(HttpStatusCode statusCode) Configure the HTTP status code that this controller should set on the response.voidsetStatusOnly(boolean statusOnly) The property can be used to indicate the request is considered fully handled within the controller and that no view should be used for rendering.voidSet a View object for the ModelAndView to return.voidsetViewName(String viewName) Set a view name for the ModelAndView to return, to be resolved by the DispatcherServlet via a ViewResolver.toString()Methods inherited from class org.springframework.web.servlet.mvc.AbstractControllerhandleRequest, isSynchronizeOnSession, setSynchronizeOnSessionMethods inherited from class org.springframework.web.servlet.support.WebContentGeneratorapplyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader, setVaryByRequestHeadersMethods inherited from class org.springframework.web.context.support.WebApplicationObjectSupportgetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class org.springframework.context.support.ApplicationObjectSupportgetApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
- 
Constructor Details- 
ParameterizableViewControllerpublic ParameterizableViewController()
 
- 
- 
Method Details- 
setViewNameSet a view name for the ModelAndView to return, to be resolved by the DispatcherServlet via a ViewResolver. Will override any pre-existing view name or View.
- 
getViewNameReturn the name of the view to delegate to, ornullif using a View instance.
- 
setViewSet a View object for the ModelAndView to return. Will override any pre-existing view name or View.- Since:
- 4.1
 
- 
getViewReturn the View object, ornullif we are using a view name to be resolved by the DispatcherServlet via a ViewResolver.- Since:
- 4.1
 
- 
setStatusCodeConfigure the HTTP status code that this controller should set on the response.When a "redirect:" prefixed view name is configured, there is no need to set this property since RedirectView will do that. However this property may still be used to override the 3xx status code of RedirectView. For full control over redirecting provide aRedirectViewinstance.If the status code is 204 and no view is configured, the request is fully handled within the controller. - Since:
- 4.1
 
- 
getStatusCodeReturn the configured HTTP status code ornull.- Since:
- 4.1
 
- 
setStatusOnlypublic void setStatusOnly(boolean statusOnly) The property can be used to indicate the request is considered fully handled within the controller and that no view should be used for rendering. Useful in combination withsetStatusCode(org.springframework.http.HttpStatusCode).By default this is set to false.- Since:
- 4.1
 
- 
isStatusOnlypublic boolean isStatusOnly()Whether the request is fully handled within the controller.
- 
handleRequestInternalprotected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception Return a ModelAndView object with the specified view name.The content of the "input" FlashMapis also added to the model.- Specified by:
- handleRequestInternalin class- AbstractController
- Throws:
- Exception
- See Also:
 
- 
toString
 
-