org.springframework.web.servlet
Interface ViewResolver

All Known Implementing Classes:
AbstractCachingViewResolver, AbstractTemplateViewResolver, BeanNameViewResolver, ContentNegotiatingViewResolver, FreeMarkerViewResolver, InternalResourceViewResolver, JasperReportsViewResolver, ResourceBundleViewResolver, TilesViewResolver, UrlBasedViewResolver, VelocityLayoutViewResolver, VelocityViewResolver, XmlViewResolver, XsltViewResolver

public interface ViewResolver

Interface to be implemented by objects that can resolve views by name.

View state doesn't change during the running of the application, so implementations are free to cache views.

Implementations are encouraged to support internationalization, i.e. localized view resolution.

Author:
Rod Johnson, Juergen Hoeller
See Also:
InternalResourceViewResolver, ResourceBundleViewResolver, XmlViewResolver

Method Summary
 View resolveViewName(java.lang.String viewName, java.util.Locale locale)
          Resolve the given view by name.
 

Method Detail

resolveViewName

View resolveViewName(java.lang.String viewName,
                     java.util.Locale locale)
                     throws java.lang.Exception
Resolve the given view by name.

Note: To allow for ViewResolver chaining, a ViewResolver should return null if 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 return null (rather throwing an exception when View creation failed).

Parameters:
viewName - name of the view to resolve
locale - Locale in which to resolve the view. ViewResolvers that support internationalization should respect this.
Returns:
the View object, or null if not found (optional, to allow for ViewResolver chaining)
Throws:
java.lang.Exception - if the view cannot be resolved (typically in case of problems creating an actual View object)