my dog learned polymorphism*
The moose likes Spring and the fly likes Web application start up (With spring) 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 "Web application start up (With spring)" Watch "Web application start up (With spring)" New topic
Author

Web application start up (With spring)

Laxmikant Kumbhare
Ranch Hand

Joined: Sep 19, 2011
Posts: 38

Hello there,

I want a method (or some functionality) to be executed after my web application starts (context loaded). I am using spring 3.0 as framework.

I tried using ServletContextListener which I implemented in my class


my listener class




and part of web.xml is




but its not printing that message.....


Please help me....
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Spring has such a listener class already called ContextLoaderListener. Try using that. You also might have to set a <context-param> to point to your config files, unless you use the naming convention of applicationContext.xml and put that in the WEB-INF directory.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web application start up (With spring)