SourceForge.net Logo

de.mindmatters.faces.spring.context.servlet
Class AbstractFacesView

java.lang.Object
  extended byorg.springframework.context.support.ApplicationObjectSupport
      extended byorg.springframework.web.context.support.WebApplicationObjectSupport
          extended byorg.springframework.web.servlet.view.AbstractView
              extended byorg.springframework.web.servlet.view.AbstractUrlBasedView
                  extended byorg.springframework.web.servlet.view.InternalResourceView
                      extended byde.mindmatters.faces.spring.context.servlet.AbstractFacesView
All Implemented Interfaces:
ApplicationContextAware, BeanNameAware, InitializingBean, View
Direct Known Subclasses:
FacesExternalResourceView, FacesInternalResourceView

public abstract class AbstractFacesView
extends InternalResourceView

Abstract view for a JSP or other resource within the same faces web application.

Rendering is delegated to the concrete implementation.

UIViewRoot creation is done by this class (if not already created by other components such as a NavigationHandler). If the view root is already created by another component, the URL of this FacesView should be null, so that view creation will be suppressed.

Author:
Andreas Kuhrwahl

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
AbstractFacesView()
          Constructor for use as a bean.
AbstractFacesView(java.lang.String url)
          Create a new FacesView with the given URL.
 
Method Summary
protected  void createView(FacesContext context)
          Creates a UIViewRoot only if the current url is not null (Urls for faces views may be null in cases of null-outcomes, validation or conversion errors etc.).
protected  java.lang.String prepareForRendering(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Must not be overridden.
protected abstract  void render(FacesContext context)
          Renders the view if the response not already completed.
protected  void renderMergedOutputModel(java.util.Map model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          
protected  boolean useInclude(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Always returns true.
 
Methods inherited from class org.springframework.web.servlet.view.InternalResourceView
exposeHelpers, exposeModelAsRequestAttributes
 
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView
afterPropertiesSet, getUrl, setUrl, toString
 
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, isContextRequired
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractFacesView

public AbstractFacesView()
Constructor for use as a bean.


AbstractFacesView

public AbstractFacesView(java.lang.String url)
Create a new FacesView with the given URL.

Parameters:
url - the URL to forward to
Method Detail

useInclude

protected final boolean useInclude(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
Always returns true.

Parameters:
request - current HTTP request
response - current HTTP response
Returns:
true

prepareForRendering

protected final java.lang.String prepareForRendering(javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.http.HttpServletResponse response)
                                              throws java.lang.Exception
Must not be overridden.

Parameters:
request - current HTTP request
response - current HTTP response
Returns:
the request dispatcher path to use
Throws:
java.lang.Exception - if preparations failed
See Also:
#prepareForRendering(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

renderMergedOutputModel

protected final void renderMergedOutputModel(java.util.Map model,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)
                                      throws java.lang.Exception

Throws:
java.lang.Exception

createView

protected void createView(FacesContext context)
Creates a UIViewRoot only if the current url is not null (Urls for faces views may be null in cases of null-outcomes, validation or conversion errors etc.).

Parameters:
context - current FacesContext

render

protected abstract void render(FacesContext context)
Renders the view if the response not already completed.

Parameters:
context - current FacesContext
See Also:
FacesContext.getResponseComplete()

SourceForge.net Logo

Copyright © 2002 mindmatters GmbH & Co. KG