I am trying to add webflow and security configuration to an operational Spring 3.1 MVC web application.
I got rid of the application-context.xml file and ContextLoaderListener, and use AnnotationConfigWebApplicationContext with an @EnableWebMvc @Configuration annotated class.
Yet, when I follow the webflow and security documentation, it seems like an application-context.xml file and ContextLoaderListener are necessary. The later seems to create a conflict with AnnotationConfigWebApplicationContext.
Can anyone provide a simple but complete Spring 3.1 MVC Web Application configuration with webflow and security enabled example? I am looking for a web.xml example file, plus any other required files.
If someone has a complete sample application downloadable online, it is even better.
The following works when deploying to Tomcat 7:
web.xml
WebConfig
Caveat: using
@Import(SomeConfig.class)does not work anymore. It causes initialization issues. The workaround is to move the content ofSomeConfig.classtoWebConfig.classitself.It is important to add proper maven dependencies, otherwise, Tomcat results in 404 Resource not found error messages:
pom.xml