Class InternalResourceView

All Implemented Interfaces:
Aware, BeanNameAware, InitializingBean, ApplicationContextAware, ServletContextAware, View
Direct Known Subclasses:
JstlView

public class InternalResourceView extends 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 RequestDispatcher.

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.
Author:
Rod Johnson, Juergen Hoeller, Rob Harrop
See Also: