tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marten Lehmann <lehm...@cnm.de>
Subject attributes in servletcontext and servletrequest
Date Tue, 26 Jul 2005 13:35:20 GMT
Hello,

within the init() of a filter, I'm storing a reference to the 
servletContext:

filterConfig.getServletContext().setAttribute("servletContext", 
filterConfig.getServletContext());

But when I'm trying to access this attribute in the doFilter-method, I 
get a NullPointerException:

ServletContext servletContext = (ServletContext) 
request.getAttribute("servletContext");

Why doesn't this work?

Regards
Marten

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message