java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractView
org.springframework.web.servlet.view.AbstractUrlBasedView
org.springframework.web.servlet.view.InternalResourceView
All Implemented Interfaces:
InitializingBean, View, BeanNameAware, ServletContextAware, ApplicationContextAware
Direct Known Subclasses:
TilesView, JstlView, TilesJstlView
A URL for this view is supposed to specify a resource within the web
application, suitable for RequestDispatcher's forward or
include method.
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 response.flushBuffer()
(which will commit the response) before rendering the view.
Typical usage with InternalResourceViewResolver looks as follows, from the perspective of the DispatcherServlet context definition:
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean>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.
Rod - JohnsonJuergen - HoellerRob - Harrop| Fields inherited from org.springframework.web.servlet.view.AbstractView: |
|---|
| DEFAULT_CONTENT_TYPE |
| Fields inherited from org.springframework.context.support.ApplicationObjectSupport: |
|---|
| logger |
| Constructor: |
|---|
|
|
|
| Method from org.springframework.web.servlet.view.InternalResourceView Summary: |
|---|
| exposeForwardRequestAttributes, exposeHelpers, getRequestToExpose, initServletContext, isContextRequired, prepareForRendering, renderMergedOutputModel, setAlwaysInclude, setExposeContextBeansAsAttributes, setExposeForwardAttributes, setExposedContextBeanNames, setPreventDispatchLoop, useInclude |
| Methods from org.springframework.web.servlet.view.AbstractUrlBasedView: |
|---|
| afterPropertiesSet, getUrl, isUrlRequired, setUrl, toString |
| Methods from org.springframework.web.servlet.view.AbstractView: |
|---|
| addStaticAttribute, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, prepareResponse, render, renderMergedOutputModel, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute, toString, writeToResponse |
| Methods from org.springframework.web.context.support.WebApplicationObjectSupport: |
|---|
| getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext |
| Methods from org.springframework.context.support.ApplicationObjectSupport: |
|---|
| getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.springframework.web.servlet.view.InternalResourceView Detail: |
|---|
Does not expose the attributes on Servlet 2.5 or above, mainly for GlassFish compatibility (GlassFish gets confused by pre-exposed attributes). In any case, Servlet 2.5 containers should finally properly support Servlet 2.4 features, shouldn't they... |
Called by #renderMergedOutputModel(Map, HttpServletRequest, HttpServletResponse) . The default implementation is empty. This method can be overridden to add custom helpers as request attributes. |
The default implementation wraps the original request for exposure of Spring beans as request attributes (if demanded). |
|
|
This implementation simply returns the configured URL. Subclasses can override this to determine a resource to render, typically interpreting the URL in a different manner. |
|
Default is "false". Switch this flag on to enforce the use of a Servlet include, even if a forward would be possible. |
This will make all such beans accessible in plain Default is "false". Switch this flag on to transparently expose all Spring beans in the request attribute namespace. NOTE: Context beans will override any custom request or session attributes of the same name that have been manually added. However, model attributes (as explicitly exposed to this view) of the same name will always override context beans. |
Default is "true" on Servlet containers up until 2.4, and "false" for Servlet 2.5 and above. Note that Servlet containers at 2.4 level and above should expose those attributes automatically! This InternalResourceView feature exists for Servlet 2.3 containers and misbehaving 2.4 containers. |
If you'd like to expose all Spring beans in the application context, switch the "exposeContextBeansAsAttributes" flag on but do not list specific bean names for this property. |
Default is "false". Switch this to "true" for convention-based views where a dispatch back to the current handler path is a definitive error. |
include or
forward method.
Performs a check whether an include URI attribute is found in the request, indicating an include request, and whether the response has already been committed. In both cases, an include will be performed, as a forward is not possible anymore. |