ServletContext -Servlet/Filter/ServletContextListener

Hi,

Is the ServletContext returned from the filter code:

ServletContext context = config.getServletContext();

different from the ServletContext returned from Servlet or ServletContextListener:

Servlet

ServletContext context = getServletContext();

ServletContextListener

this.context = event.getServletContext();

I think I have tried everything to initialize the values in the ServletContext in the Filter, I always get a NULL, my only assumption is that these are 2 separate objects? Is this true?

[552 byte] By [nemcovaa] at [2007-11-27 8:19:28]
# 1
If you look in the API docs, you find loads of useful information such asThere is one context per "web application" per Java Virtual Machine
curry_monstera at 2007-7-12 20:07:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Yep, I did that already, I only post as a last resort. I found out already, the filter was under one context, the listener under another, that's why it was not showing up. I move the listener to the filter context and now it works. Yay!
nemcovaa at 2007-7-12 20:07:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...