- Web Application needs to use application context files bundled in separate projects.
- Insert the following into web.xml file
classpath* - searches for files in the classpath.
Project A - contains projectA-context.xml
Project B - contains projectB-context.xml
Project C - contains application-context.xml
Project D - contains application-context.xml
All 4 context files will be loaded in that order if all 4 projects are in the classpath
- Insert the following into web.xml file
- JUnit testing with multiple application context files bundled in separate projects.
- Add all dependent projects to the classpath when executing JUnit
- Include other resources in your main application context
Project A - executed with JUnit, Spring container initiallized with projectA-context.xml
Project B - contains projectB-context.xml
Project C - contains application-context.xml
Project D - contains application-context.xml
All 4 context files will be loaded in that order if all 4 projects are in the classpath
- Spring application context injecting into JUnit
Thursday, March 1, 2012
Spring - Multiple Application Context files from Different Projects
Labels:
Spring
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment