Class BeanNameViewResolver
- All Implemented Interfaces:
- Aware,- ApplicationContextAware,- Ordered,- ServletContextAware,- ViewResolver
ViewResolver
 that interprets a view name as a bean name in the current application context,
 i.e. typically in the XML file of the executing DispatcherServlet
 or in a corresponding configuration class.
 Note: This ViewResolver implements the Ordered interface
 in order to allow for flexible participation in ViewResolver chaining.
 For example, some special views could be defined via this ViewResolver
 (giving it 0 as "order" value), while all remaining views could be resolved by
 a UrlBasedViewResolver.
- Since:
- 18.06.2003
- Author:
- Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class org.springframework.context.support.ApplicationObjectSupportloggerFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructors
- 
Method SummaryMethods 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- 
BeanNameViewResolverpublic BeanNameViewResolver()
 
- 
- 
Method Details- 
setOrderpublic void setOrder(int order) Specify the order value for this ViewResolver bean.The default value is Ordered.LOWEST_PRECEDENCE, meaning non-ordered.- See Also:
 
- 
getOrderpublic int getOrder()Description copied from interface:OrderedGet the order value of this object.Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet load-on-startupvalues).Same order values will result in arbitrary sort positions for the affected objects. 
- 
resolveViewNameDescription copied from interface:ViewResolverResolve the given view by name.Note: To allow for ViewResolver chaining, a ViewResolver should return nullif a view with the given name is not defined in it. However, this is not required: Some ViewResolvers will always attempt to build View objects with the given name, unable to returnnull(rather throwing an exception when View creation failed).- Specified by:
- resolveViewNamein interface- ViewResolver
- Parameters:
- viewName- name of the view to resolve
- locale- the Locale in which to resolve the view. ViewResolvers that support internationalization should respect this.
- Returns:
- the View object, or nullif not found (optional, to allow for ViewResolver chaining)
- Throws:
- BeansException
 
 
-