Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

controller not getting call on start up

 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have written a sample EAR project, the EAR file consists of EJB3 and Spring 3.0.6 in the WAR module.
Deployment gone through successfully, but the controller is not getting call.

Here is my mvc-dispatcher-servlet.xml file:



web.xml file:


controller class:



Log message from deployment:


war file:



Any suggestion would be very appreciated.
Thanks
Sam
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is confusing me. Looks like you have two different things mixed up.



The context param is for the ContextLoaderListener creating an ApplicationContext for just the middle tier beans. The mvc-dispatcher-servlet.xml is following the naming convention of the file that the DispatcherServlet looks for to create the other ApplicationContext that is just for the web layer beans.

In a Spring MVC app you should have 2 ApplicationContexts. One for middle tier beans using ContextLoaderLister and one for the web layer beans using DispatcherServlet. To tell the DispatcherServlet where its config file is, you use the init-param tag in the <servlet> tag in your web.xml

Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic