-
Nov 26th, 2012, 02:47 PM
#1
How configure multiplue applicationContext files in Spring
Hi All,
Can any one suggest mw, how configure multipule apllcation context files in spring2.X(Since i am not using the spring 3.X, i can not use casspath*
.
And also please sugggest me, how to load the diffrent flow.xmls & def.xmls files, which are part of sub-projects(reffered as jar files in main web application) of web applcations.
Senario is like below,
I have base project, which has the base flow.xml and def.xml, this base project wil be refered(included as jar file) in a web aplication.
When i was trying to load base flow.xml form flow.xml of web application, the application is unable to find the base flows.
Sample code as fllows
web.xml----->
<servlet>
<servlet-name>testContext</servlet-name>
<servlet-class>com.***.**.**.xxxDispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
test/ApplicationContext-servlet.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>testContext</servlet-name>
<url-pattern>/test/*</url-pattern>
</servlet-mapping>
---------------------------------------------------------------
ApplicationContext-servlet.xml ---->
<bean class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
<property name="alwaysUseFullPath" value="true" />
<property name="mappings">
<props>
<prop key="/test/**">flowController</prop>
<prop key="/test1/**">baseflowController</prop>
</props>
</property>
</bean>
<bean id="flowController" class="org.springframework.webflow.mvc.servlet.Flo wController">
<property name="flowExecutor" ref="flowExecutor" />
</bean>
<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry"/>
<webflow:flow-registry id="flowRegistry">
<webflow:flow-location-pattern value="/spring/flows/test/**/*-flow.xml" />
</webflow:flow-registry>
where baseflowController is imported to ApplicationContext as fllows
<import resource="baseflowController.xml"/>
----------------------------------------
baseflowController.xml---->
<bean id="baseflowController" class="org.springframework.webflow.mvc.servlet.Flo wController">
<property name="flowExecutor" ref="flowExecutor" />
</bean>
<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry"/>
<webflow:flow-registry id="flowRegistry">
<webflow:flow-location-pattern value="/spring/flows/test1/**/*-flow.xml" />
</webflow:flow-registry>
-----------------------------------------------------------------------------------------
To breaf, I am trying to load base flow.xml 's in baseflowController.xml and web application specific flow.xml's in ApplicationContext.
Can any one healp me, how to make it work the above senario.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules