Jason Hunter wrote:
>
> Jean-Michel Leon wrote:
>
> > I didn't say I'd consider 1.0 unstable. I'd expect a 1.0 release of
> > Tomcat to be complete, compliant and solid. this 3.0 release of tomcat
> > is a joke. and my point is that this is not good for the OS community.
>
> There were earlier releases in different forms with various numbers.
> 3.0 indicates Tomcat is a replacement for all of them.
>
> > > > among all the things that are not working properly:
> > > >
> > > > - response.setHeader("Content-Type", "foo/bar"); does not set the
> > > > content-type
> > >
> > > Are you by chance calling it at the wrong time (i.e. after the
> > > response is
> > > committed to the output stream)?
> >
> > I don't think I'm doing anything illegal, I've reduced it to a sample
> > JSP file containing simply:
> > <%
> >     response.setHeader("Content-Type", "foo/bar");
> > %>
> > and it still fails.
>
> Ah, you are doing the call from a JSP!  Look at the
> <%@ page contentType="text/html" %> directive.  That's how the spec
> says to set the content type from a JSP.
>
> > I'm not sure if this is compliant with the spec
>
> So check out the JSP spec.


I did. It's just that the spec (JSP 1.0, p43, 2.7.1) doesn't say that
this is the only way people should use to set the mime type. Since in
our case, the mime type is not static for this page (it's computed based
on the user agent we're talking to), I believe (correct me if I'm wrong)
I can't do that with the page directive.

Also, the real issue is that:
- setHeader works perfectly with any other header; the servlet specs
don't mention we shouldn't use it for the content-type.
- response.setContentType works perfectly at the same location; the
servlet spec does say that it has to be called before acquiring the
PrintWriter, which I believe I do, since it's working.
- if I was calling it at the wrong time, I'd expect to get an
IllegalStateException. here I get nothing, but the mime type is silently
set to text/hml.

Maybe the JSP1.1 spec says something different (havn't read it yet), but
it this case, it means there is a backward compatibility issue with 1.0.



jm.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to