File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Web application start up (With spring)" Watch "Web application start up (With spring)" New topic

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

Joined: Feb 05, 2001
Posts: 17276

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.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Web application start up (With spring)
It's not a secret anymore!