Class InternalResourceViewResolver

All Implemented Interfaces:
Aware, ApplicationContextAware, Ordered, ServletContextAware, ViewResolver

public class InternalResourceViewResolver extends UrlBasedViewResolver
Convenient subclass of UrlBasedViewResolver that supports InternalResourceView (i.e. Servlets and JSPs) and subclasses such as JstlView.

The view class for all views generated by this resolver can be specified via UrlBasedViewResolver.setViewClass(java.lang.Class<?>). See UrlBasedViewResolver's javadoc for details. The default is InternalResourceView, or JstlView if the JSTL API is present.

BTW, it's good practice to put JSP files that just serve as views under WEB-INF, to hide them from direct access (e.g. via a manually entered URL). Only controllers will be able to access them then.

Note: When chaining ViewResolvers, an InternalResourceViewResolver always needs to be last, as it will attempt to resolve any view name, no matter whether the underlying resource actually exists.

Juergen Hoeller
See Also: