open class AbstractTemplateViewResolver : UrlBasedViewResolver
Abstract base class for template view resolvers, in particular for FreeMarker views. Provides a convenient way to specify AbstractTemplateView's exposure flags for request attributes, session attributes, and Spring's macro helpers. |
|
open class BeanNameViewResolver : WebApplicationObjectSupport, ViewResolver, Ordered
A simple implementation of org.springframework.web.servlet.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 This resolver can be handy for small applications, keeping all definitions ranging from controllers to views in the same place. For larger applications, XmlViewResolver will be the better choice, as it separates the XML view bean definitions into a dedicated views file. Note: Neither this Note: This |
|
open class ContentNegotiatingViewResolver : WebApplicationObjectSupport, ViewResolver, Ordered, InitializingBean
Implementation of ViewResolver that resolves a view based on the request file name or The This view resolver uses the requested MediaType to select a suitable View for a request. The requested media type is determined through the configured ContentNegotiationManager. Once the requested media type has been determined, this resolver queries each delegate view resolver for a View and determines if the requested media type is compatible with the view's content type). The most compatible view is returned. Additionally, this view resolver exposes the For example, if the request path is |
|
open class DefaultRequestToViewNameTranslator : RequestToViewNameTranslator
RequestToViewNameTranslator that simply transforms the URI of the incoming request into a view name. Can be explicitly defined as the The default transformation simply strips leading and trailing slashes as well as the file extension of the URI, and returns the result as the view name with the configured The stripping of the leading slash and file extension can be disabled using the Find below some examples of request to view name translation.
|
|
open class InternalResourceView : AbstractUrlBasedView
Wrapper for a JSP or other resource within the same web application. Exposes model objects as request attributes and forwards the request to the specified resource URL using a javax.servlet.RequestDispatcher. A URL for this view is supposed to specify a resource within the web application, suitable for RequestDispatcher's If operating within an already included request or within a response that has already been committed, this view will fall back to an include instead of a forward. This can be enforced by calling Typical usage with InternalResourceViewResolver looks as follows, from the perspective of the DispatcherServlet context definition: Every view name returned from a handler will be translated to a JSP resource (for example: "myView" -> "/WEB-INF/jsp/myView.jsp"), using this view class by default.
|
|
open class JstlView : InternalResourceView
Specialization of InternalResourceView for JSTL pages, i.e. JSP pages that use the JSP Standard Tag Library. Exposes JSTL-specific request attributes specifying locale and resource bundle for JSTL's formatting and message tags, using Spring's locale and org.springframework.context.MessageSource. Typical usage with InternalResourceViewResolver would look as follows, from the perspective of the DispatcherServlet context definition: Every view name returned from a handler will be translated to a JSP resource (for example: "myView" -> "/WEB-INF/jsp/myView.jsp"), using this view class to enable explicit JSTL support.
The specified MessageSource loads messages from "messages.properties" etc files in the class path. This will automatically be exposed to views as JSTL localization context, which the JSTL fmt tags (message etc) will use. Consider using Spring's ReloadableResourceBundleMessageSource instead of the standard ResourceBundleMessageSource for more sophistication. Of course, any other Spring components can share the same MessageSource. This is a separate class mainly to avoid JSTL dependencies in InternalResourceView itself. JSTL has not been part of standard J2EE up until J2EE 1.4, so we can't assume the JSTL API jar to be available on the class path. Hint: Set the |
|
open class ResourceBundleViewResolver : AbstractCachingViewResolver, Ordered, InitializingBean, DisposableBean
A org.springframework.web.servlet.ViewResolver implementation that uses bean definitions in a ResourceBundle, specified by the bundle basename. The bundle is typically defined in a properties file, located in the classpath. The default bundle basename is "views". This Note: This |
|
open class XmlViewResolver : AbstractCachingViewResolver, Ordered, InitializingBean, DisposableBean
A org.springframework.web.servlet.ViewResolver implementation that uses bean definitions in a dedicated XML file for view definitions, specified by resource location. The file will typically be located in the WEB-INF directory; the default is "/WEB-INF/views.xml". This Note: This |