This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Spring and the fly likes controller not getting call on start up Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "controller not getting call on start up" Watch "controller not getting call on start up" New topic
Author

controller not getting call on start up

sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
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
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: controller not getting call on start up