You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Kjome <ho...@visi.com> on 2002/09/12 08:38:32 UTC

HttpServletResponse question...

I am trying out an XSLT filter in one of the JDCTechTips:
http://developer.java.sun.com/developer/JDCTechTips/2001/tt0626.html


The setContentType() is overridden in the response wrapper.  The way they 
have it set up, though, seems to assume that this method will get called 
automatically since there is no place in the filter that they specifically 
call wrapper.setContentType().  The thing is, setContentType() never gets 
called automatically in Tomcat-4.1.10.

Is the creator of this filter just making an incorrect assumption or is 
Tomcat being buggy by not automatically calling setContentType() on the 
wrapper when filterChain.doFilter(request, wrappedHResponse); is called?

The only way I can make this filter work is if I specifically call 
wrappedHResponse.setContentType("text/xml"); before 
filterChain.doFilter(request, wrappedHResponse);.  Should I have to do 
this?  If so, why didn't the original author do it?  If Tomcat is doing the 
right thing, then the developer who created this example must never have 
tested it because it won't work until that call is specifically made.

Can anyone tell me who is right here?

Jake


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>