JSF-Spring

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

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.view.AbstractCachingViewResolver
              extended by org.springframework.web.servlet.view.UrlBasedViewResolver
                  extended by de.mindmatters.faces.spring.context.servlet.FacesViewResolver
All Implemented Interfaces:
ApplicationContextAware, Ordered, ServletContextAware, ViewResolver

public class FacesViewResolver
extends UrlBasedViewResolver

Convenience subclass of UrlBasedViewResolver that supports FacesView.

Author:
Andreas Kuhrwahl
See Also:
#createView(java.lang.String, java.util.Locale), UrlBasedViewResolver.setViewClass(java.lang.Class)

Field Summary
 
Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
FacesViewResolver()
          Sets default viewClass to AbstractFacesView.
 
Method Summary
protected  View createView(java.lang.String viewName, java.util.Locale locale)
          Overridden to implement check for "redirect:" prefix.
protected  java.lang.Class requiredViewClass()
          Return the required type of view for this resolver.
 
Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver
buildView, canHandle, getAttributesMap, getCacheKey, getContentType, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
 
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver
clearCache, isCache, removeFromCache, resolveViewName, setCache
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, isContextRequired, setServletContext
 
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

FacesViewResolver

public FacesViewResolver()
Sets default viewClass to AbstractFacesView.

See Also:
UrlBasedViewResolver.setViewClass(java.lang.Class)
Method Detail

requiredViewClass

protected final java.lang.Class requiredViewClass()
Return the required type of view for this resolver. This implementation returns AbstractUrlBasedView.

Overrides:
requiredViewClass in class UrlBasedViewResolver
See Also:
AbstractUrlBasedView

createView

protected final View createView(java.lang.String viewName,
                                java.util.Locale locale)
                         throws java.lang.Exception
Overridden to implement check for "redirect:" prefix.

Not possible in loadView, since overridden loadView versions in subclasses might rely on the superclass always creating instances of the required view class.

Overrides:
createView in class UrlBasedViewResolver
Parameters:
viewName - the name of the view to retrieve
locale - the Locale to retrieve the view for
Returns:
the View instance, or null if not found (optional, to allow for ViewResolver chaining)
Throws:
java.lang.Exception - if the view couldn't be resolved
See Also:
UrlBasedViewResolver.loadView(java.lang.String, java.util.Locale), UrlBasedViewResolver.requiredViewClass()

JSF-Spring

Copyright © 2006 mindmatters GmbH & Co. KG