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):
- none
- request
- session
- application
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
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.
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
Copyright © 2002 mindmatters GmbH & Co. KG