One of the things I was aiming to do with Gaijin was create all of the supporting Spring configuration files automatically from Eclipse. Right now it generates the controller config file for you (flow controller bean, flow builder bean, and unique per-flow message source). It also creates a per-flow supporting config file where you add your actions, viewResolver, etc. Both of the config files are automatically mapped to the dispatcher servlet for the controller in the web.xml. Here is the web.xml Gaijin generates for the project I am testing with ..
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>phoneNumberList</servlet-name>
<display-name>Phone Number Listing Process</display-name>
<description>This flow allows a user to search for phone numbers and produces a list.</description>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/contexts/PhoneNumberList-generated.xml, WEB-INF/contexts/PhoneNumberList-support.xml</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>user_createUser</servlet-name>
<display-name>Create User</display-name>
<description>Create a new user.</description>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/contexts/user/CreateUser-generated.xml, WEB-INF/contexts/user/CreateUser-support.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>phoneNumberList</servlet-name>
<url-pattern>/phoneNumberList.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>user_createUser</servlet-name>
<url-pattern>/user/createUser.do</url-pattern>
</servlet-mapping>
</web-app>
... and the supporting PhoneNumberList-generated.xml for the main web flow...
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource">
<property name="cacheSeconds">
<value>10</value>
</property>
<property name="basenames">
<list>
<value>WEB-INF/resources/PhoneNumberList</value>
</list>
</property>
</bean>
<bean class="org.springframework.web.flow.mvc.FlowController" id="phoneNumberListController" name="/phoneNumberList.do">
<property name="cacheSeconds">
<value>0</value>
</property>
<property name="flow">
<ref bean="phoneNumberList"/>
</property>
</bean>
<bean class="org.springframework.web.flow.config.FlowFactoryBean" id="phoneNumberList">
<property name="flowBuilder">
<bean class="gen.PhoneNumberListBuilder"/>
</property>
</bean>
</beans>
I'll take a look at combining the flow declarations into a central bean context file to get around the bean referencing problem. Maybe it makes sense to add them as an extra context config file at the root context level so that all controllers will have access to them automatically.
Thanks for your quick response!
Derek
dadams@gaijin-studio.org