Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

event.getServletContext() returning Null in a ServletContextListener

 
Jason Soper
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I have a ServletContextListener set up to add an ELResolver to the resolver chain. The listener looks a bit like this:



I have the listener registered in the web.xml like this:



This is all working fine on my local machine. The code is running wirhout error and the ELResolver is being added and functioning correctly.

My problem is when I run the code on our test server. I'm not sure what's different, but in that environment it falls over when it tries to use context. As far as I can tell, event.getServletContext() is returning null.

Can anyone suggest what might be causing this? Or is there another way of doing this? This is a Spring application, if that makes any difference.

Thanks,

Jason
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic