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 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" <sthompso@notes.state.ne.us>
 ===
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