O
odelya
Hello!
I wrote the ffollowing filter:
private FilterConfig filterConfig = null;
/**
* overwritten.
*/
public void destroy() {
filterConfig = null;
}
/**
* filters parameters: ContentType and expires.
*/
public void doFilter(ServletRequest arg0, ServletResponse arg1,
FilterChain arg2) throws IOException, ServletException {
if (filterConfig == null)
return;
HttpServletRequest request = (HttpServletRequest) arg0;
HttpServletResponse response = (HttpServletResponse) arg1;
System.out.print(request.getContextPath());
System.out.print(request.getContentLength());
arg2.doFilter(request, response);
}
/* (non-Javadoc)
* @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
*/
public void init(FilterConfig arg0) throws ServletException {
this.filterConfig = arg0;
}
and i get messege:
for ContextPath(): /servlet
for ContentLength(): -1.
How come I don't get any content?
Thank you
I wrote the ffollowing filter:
private FilterConfig filterConfig = null;
/**
* overwritten.
*/
public void destroy() {
filterConfig = null;
}
/**
* filters parameters: ContentType and expires.
*/
public void doFilter(ServletRequest arg0, ServletResponse arg1,
FilterChain arg2) throws IOException, ServletException {
if (filterConfig == null)
return;
HttpServletRequest request = (HttpServletRequest) arg0;
HttpServletResponse response = (HttpServletResponse) arg1;
System.out.print(request.getContextPath());
System.out.print(request.getContentLength());
arg2.doFilter(request, response);
}
/* (non-Javadoc)
* @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
*/
public void init(FilterConfig arg0) throws ServletException {
this.filterConfig = arg0;
}
and i get messege:
for ContextPath(): /servlet
for ContentLength(): -1.
How come I don't get any content?
Thank you