views:

18

answers:

1

I have a project that uses Spring Webflow 2, extensively. There's well over 30 flows, each with a non-trivial number of beans. I've noticed that the application has been slowly gaining in startup time, and after setting the log level to debug and running through the logs, it looks like the problem is the increasing number of flows. To clarify a bit, I have several applicationContext files in my Spring app that are common, and then beans specific to each flow are placed in their own file, and then included in the larger applicationContext with an <import> element. Is there a better way to structure the beans I use with webflow ? It's at the point where the startup time is becoming an issue.

A: 

I was using a validator setup that used one central registry for Hibernate-based validators, and created Spring validators by referencing that central registry from each webflow flow application context that I was creating. The parent application context lookups turned out to be what was taking the majority of the time. I refactored them to all use a single, common validator under the Spring Validator interface, and cut the application startup time in half.

Alex Marshall