Announcement Announcement Module
No announcement yet.
Spring with Tomcat Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

    Best Regards

  • #2
    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.