|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
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. Will fall back to an include if already in an included request.
A URL for this view is supposed to specify a resource within the web application, i.e. suitable for RequestDispatcher's forward/include methods.
RequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
,
RequestDispatcher.include(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
Field Summary |
Fields inherited from class org.springframework.web.servlet.view.AbstractView |
DEFAULT_CONTENT_TYPE |
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
logger |
Constructor Summary | |
InternalResourceView()
Constructor for use as a bean. |
|
InternalResourceView(String url)
Create a new InternalResourceView with the given URL. |
Method Summary | |
protected void |
exposeHelpers(HttpServletRequest request)
Expose helpers unique to each rendering operation. |
protected void |
exposeModelAsRequestAttributes(Map model,
HttpServletRequest request)
Expose the model objects in the given map as request attributes. |
protected String |
prepareForRendering(HttpServletRequest request,
HttpServletResponse response)
Prepare for rendering, and determine the request dispatcher path to forward to respectively to include. |
protected void |
renderMergedOutputModel(Map model,
HttpServletRequest request,
HttpServletResponse response)
Render the internal resource given the specified model. |
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView |
getUrl, initApplicationContext, setUrl |
Methods inherited from class org.springframework.web.servlet.view.AbstractView |
addStaticAttribute, createRequestContext, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute |
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
getServletContext, getTempDir, getWebApplicationContext |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InternalResourceView()
public InternalResourceView(String url)
url
- the URL to forward toMethod Detail |
protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception
renderMergedOutputModel
in class AbstractView
model
- combined output Map (never null),
with dynamic values taking precedence over static attributesrequest
- current HTTP requestresponse
- current HTTP response
Exception
- if rendering failedprotected void exposeModelAsRequestAttributes(Map model, HttpServletRequest request) throws Exception
Called by renderMergedOutputModel. This method is suitable for all resources reachable by RequestDispatcher.
model
- Map of model objects to exposerequest
- current HTTP request
Exception
renderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
,
RequestDispatcher
protected void exposeHelpers(HttpServletRequest request) throws Exception
Called by renderMergedTemplateModel. The default implementation is empty. This method can be overridden to add custom helpers as request attributes.
request
- current HTTP request
Exception
- if there's a fatal error while we're adding attributesrenderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
,
JstlView.exposeHelpers(javax.servlet.http.HttpServletRequest)
,
TilesJstlView.exposeHelpers(javax.servlet.http.HttpServletRequest)
protected String prepareForRendering(HttpServletRequest request, HttpServletResponse response) throws Exception
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.
request
- current HTTP requestresponse
- current HTTP response
Exception
- if preparations failedAbstractUrlBasedView.getUrl()
,
TilesView.prepareForRendering(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |