tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakarta Tomcat Newsgroup ( <>
Subject Problem with Filters - Tomcat 4.0.1
Date Mon, 29 Apr 2002 20:25:01 GMT
Subject: Problem with Filters - Tomcat 4.0.1
From: "Shaun Thompson" <>

I'm trying to run a filter for my jsp's formatting the output I get back for
a wap enabled browser.  The problem that I run into is when I stuff the
response in a wrapper and send it down the filter chain I can no longer set
the content type when I want to write the output to the printwriter.

It looks like the response has already been committed somewhere down the
chain.  I want to set the content type to "text/vnd.wap.wml" but all I get
back in the http header is "Content-Type: text/html;charset=ISO-8859-1"

Here is a sample of what I'm trying to do.
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) {

H2WResponseWrapper h2wResponseWrapper = new
H2WResponseWrapper((HttpServletResponse) response);

chain.doFilter(request, h2wResponseWrapper);

 PrintWriter printwriter = response.getWriter();

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message