Nov 1st, 2010, 01:14 AM
Spring with Tomcat
I have a 3-tier appln hosted in Tomcat; web, service and DAO layers.
How do you integrate Tomcat and Spring? I need to make use of Spring's dependency injection, transaction management, etc.
I can only think of instantiating a ClassPathXmlApplicationContext but this way the ApplicationContext singleton instance is not visible across layers.
Thanks in advance.
Nov 1st, 2010, 06:13 AM
I'm not sure you're asking the right question. You shouldn't need to integrate Spring and Tomcat directly. Tomcat is merely the servlet container in which you deploy your app, be it a Spring app or not.
If you're trying to create a web app with Spring, the Spring DispatcherServlet will pass requests off to handlers and controllers in the Spring container, so you wouldn't need to instantiate an application context yourself.
Tags for this Thread