File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "controller not getting call on start up" Watch "controller not getting call on start up" New topic

controller not getting call on start up

sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 229

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.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

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


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: controller not getting call on start up
It's not a secret anymore!