> > > 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.
> I'm not sure if this is compliant with the spec, but on the same
> conditions response.setContentType works. so I guess one of them is
> wrong.
For what it's worth, I have successfully used constructs like the following
with Tomcat:
<%
if (sendXML() == true) {
response.setContentType ("text/xml");
} else {
response.setContentType ("text/html");
}
%>
However, you get a servlet error if you do this:
<%
if (sendXML() == true) {
<%@ page contentType="text/xml" %>
} else {
<%@ page contentType="text/html" %>}
%>
Despite what the spec recommends, it would be very "painful" (for me at
least) if any JSP engine could not handle the "response.setContentType()"
approach.
dean
Dean Wampler, Ph.D.
System Design Engineer
Mercata, Inc.
110 110th Ave. NE
Bellevue, WA 98004-5840
mailto:[EMAIL PROTECTED]
http://www.mercata.com
(425)468-9723
I want my tombstone to say:
"Unknown Application Error in DeanWampler.exe.
Application Terminated"
===========================================================================
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