Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

servlet filter gets null context

2 views
Skip to first unread message

odelya

unread,
Aug 30, 2007, 5:00:55 AM8/30/07
to
Hi,
I have the following filter:
/**
* filters parameters: ContentType and expires.
*/
public void doFilter(ServletRequest req, ServletResponse resp,
FilterChain chain) throws IOException, ServletException {
if (filterConfig == null)
return;
System.out.print(req.getCharacterEncoding());
System.out.print(req.getContentLength());
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp;
System.out.print(request.getCharacterEncoding());
System.out.print(response .getContentLength());
in both prints I get:
NULL
-1

I am sending a jps page.
What could be the problem?

0 new messages