tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakarta Tomcat Newsgroup (@Basebeans.com) <jakarta-...@basebeans.com>
Subject Re: Problem with Filters - Tomcat 4.0.1
Date Mon, 29 Apr 2002 20:55:01 GMT
Subject: Re: Problem with Filters - Tomcat 4.0.1
From: "Shaun Thompson" <sthompso@notes.state.ne.us>
 ===
Answered my own question.  The setContentType() on my responseWrapper was
being called again downstream before the response was committed setting the
content type back to text/html.


"Shaun Thompson" <sthompso@notes.state.ne.us> wrote in message
news:aak9ea$td4$1@basebeans.com...
> Hello,
>
> 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);
>
>  response.setContentType("text/vnd.wap.wml");
>  PrintWriter printwriter = response.getWriter();
> ......
>
>



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message