[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3639) Need support for hierarchical beanRefFactory in ContextLoader

Bob Shanahan (JIRA) jira-events at lists.jboss.org
Tue Oct 28 11:03:21 EDT 2008


Need support for hierarchical beanRefFactory in ContextLoader
-------------------------------------------------------------

                 Key: JBSEAM-3639
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3639
             Project: Seam
          Issue Type: Feature Request
          Components: Spring
    Affects Versions: 2.1.0.GA
            Reporter: Bob Shanahan


The Spring ContextLoaderListener allows loading of shared (by multiple wars), hierarchical contexts as in the following sample web.xml config:

  <context-param>
      <param-name>contextConfigLocation</param-name>		
      <param-value>/WEB-INF/applicationContext.xml</param-value>
   </context-param>
   <context-param>
      <param-name>locatorFactorySelector</param-name>
      <param-value>classpath:com/i2i/services/beanRefFactory.xml</param-value>
   </context-param>
   <context-param>
      <param-name>parentContextKey</param-name>
      <param-value>i2i.services</param-value>
   </context-param>
   <context-param>
      <param-name>webAppRootKey</param-name>
      <param-value>i2i.webt</param-value>
   </context-param>
    
   <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
   </listener>

The Seam ContextLoader, however, only allows loading of one or more application contexts, neither allowing single instances of shared contexts nor allowing for hierarchical contexts (via setting of parent context key).

Attempts to overcome the limitation with the following <spring:context-loader> config and beanRefFactory.xml fails as only the beans defined in the beanRefFactory are directly visible to Seam.

<spring:context-loader>
    	<spring:config-locations>
    		<value>classpath:com/i2i/services/beanRefFactory.xml</value>
    		<value>/WEB-INF/beanRefFactory.xml</value>
    	</spring:config-locations>
</spring:context-loader>


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
		  "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
	<bean id="i2i.web" lazy-init="false"
		class="org.springframework.context.support.ClassPathXmlApplicationContext">
		<constructor-arg>
			<list>
				<value>
					/WEB-INF/applicationContext.xml
				</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<ref bean="i2i.services" />
		</constructor-arg>
	</bean>
</beans>





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list