This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 17249
    
    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
 
wood burning stoves
 
subject: Web application start up (With spring)
 
Similar Threads
not able to get the context attribute set in ServletContextListener
Spring annotation no handler found
When HttpSessionAttributeListener and HttpSessionBindingListener methods are called?
JSF 1.2 + Authentication with Spring Security 3.0.5
NullPointerExeption when connecting to MS SQL