SourceForge.net Logo

de.mindmatters.faces.spring.context
Interface FacesWebApplicationContext

All Superinterfaces:
ApplicationContext, ApplicationEventPublisher, BeanFactory, ConfigurableApplicationContext, ConfigurableWebApplicationContext, HierarchicalBeanFactory, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver, ThemeSource, WebApplicationContext
All Known Implementing Classes:
DefaultFacesWebApplicationContext

public interface FacesWebApplicationContext
extends ConfigurableWebApplicationContext

Provides configuration for managed beans. Typically managed beans implement the business logic related to the frontend integration.

Implementations should take configuration from faces, spring configuration and jsf-spring configuration XML documents.
More precisely config files must be compatible with the following DTD's:

Note: config files compatible with the "jsf-spring-beans.dtd" may define the scope of a bean via the bean-element attribute scope.
Example XML context definition:

  <bean id="foo" class="foo.Bar" scope="session">
    ...
  </bean>
 
Predefined scopes (could be extended):


By default, the configuration will be taken from "/WEB-INF/faces-config.xml" (JSF-configuration) and from "/WEB-INF/faces-spring-context.xml" (bean definitions in a common spring configuration XML document or a jsf-spring configuration XML document) for the faces root context, if the files exist. Furthermore configuration will be taken from "/META-INF/faces-config.xml" and from "/META-INF/faces-spring-context.xml" of any deployed jar in the classpath.

The config location defaults can be overridden via the "javax.faces.CONFIG_FILES" context param and also the "faces.spring.CONTEXT_FILES" context param of ContextLoaderListener for configuration files based on the spring beans DTD or the jsf-spring beans DTD respectively. Config locations for configuration files based on the spring beans DTD/jsf-spring beans DTD can either denote concrete files like "/WEB-INF/context.xml" or Ant-style patterns like "/WEB-INF/*-context.xml" (see PathMatcher javadoc for pattern details).

Author:
Andreas Kuhrwahl

Field Summary
static java.lang.String ROOT_FACES_WEB_APPLICATION_CONTEXT_ATTRIBUTE
          Context attribute to bind faces root WebApplicationContext to on successful startup.
 
Fields inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext
CONFIG_LOCATION_DELIMITERS
 
Fields inherited from interface org.springframework.web.context.WebApplicationContext
ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
 
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
 
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX, CLASSPATH_URL_PREFIX
 
Method Summary
 void setFacesSpringConfigLocations(java.lang.String[] locations)
          Sets the config locations.
 void setManagedBeanFactoryClass(java.lang.Class factoryClass)
          Sets the class for the internal used BeanFactory.
 
Methods inherited from interface org.springframework.web.context.ConfigurableWebApplicationContext
setConfigLocations, setNamespace, setServletContext
 
Methods inherited from interface org.springframework.web.context.WebApplicationContext
getServletContext
 
Methods inherited from interface org.springframework.context.ApplicationContext
getDisplayName, getParent, getStartupDate, publishEvent
 
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType
 
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getType, isSingleton
 
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
getParentBeanFactory
 
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
 
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
 
Methods inherited from interface org.springframework.core.io.ResourceLoader
getResource
 
Methods inherited from interface org.springframework.ui.context.ThemeSource
getTheme
 
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addBeanFactoryPostProcessor, close, getBeanFactory, refresh, setParent
 

Field Detail

ROOT_FACES_WEB_APPLICATION_CONTEXT_ATTRIBUTE

public static final java.lang.String ROOT_FACES_WEB_APPLICATION_CONTEXT_ATTRIBUTE
Context attribute to bind faces root WebApplicationContext to on successful startup.

Note: If the startup of the root context fails, this attribute can contain an exception or error as value. Use FacesWebApplicationContextUtils for convenient lookup of the root WebApplicationContext.

Method Detail

setManagedBeanFactoryClass

public void setManagedBeanFactoryClass(java.lang.Class factoryClass)
Sets the class for the internal used BeanFactory. The BeanFactory must implement ManagedBeanFactory. Usually the ManagedBeanFactory will be set by the ContextLoader.

Parameters:
factoryClass - the class of the internal BeanFactory
See Also:
ContextLoader.createFacesConfigWebApplicationContext(javax.servlet.ServletContext, org.springframework.context.ApplicationContext)

setFacesSpringConfigLocations

public void setFacesSpringConfigLocations(java.lang.String[] locations)
Sets the config locations. Should be config files compatible with the "spring-beans.dtd" respectively "jsf-spring-beans.dtd".

Parameters:
locations - the config locations

SourceForge.net Logo

Copyright © 2002 mindmatters GmbH & Co. KG