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
GArlington - 30 Aug 2007 12:13 GMT
> Hello!
> I wrote the ffollowing filter:
[quoted text clipped - 36 lines]
>
> Thank you
ContentLength() = -1 is not empty, it is unknown.
See http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletRequest.html#
getContentLength()