views:

91

answers:

1

I'm defining a lot of flows and each of my flows has a lot of actions within its states.

The namespace seems to be getting fairly crowded now, so I'm wondering if it's possible to define the spring beans for flow actions from within the flow.xml or some other way such that it's visible to the flow, but not to other flows, but still has access to the greater spring context (for things such as service injections)

A: 

You have 1 spring context and therefore you can't have beans invisible for each other. That said, you can put different beans wit different ids in different xmls, using either:

in web.xml:

<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/flow1.xml,/WEB-INF/flow2.xml</param-value>
 </context-param>

or in applicationContext.xml (your flowX.xml should be under /WEB-INF/classes - i.e. the root of the classpath):

<import resource="classpath*:/flow1.xml" />
<import resource="classpath*:/flow2.xml" />
Bozho
Thanks for the response. I thought it was the case, but I'm fairly sure I've seen beanFactories exist within nested contexts before. No idea if they can be plumbed to webflow though
The Trav