tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Different Content Type returned by Tomcat 4.1 and Tomcat 4.0. Please Help!
Date Wed, 09 Apr 2003 12:58:04 GMT

Howdy,

>Although, I still have a feeling that certain Tomcat configuration
options
>should be available in order to make it handle the Content Type in the
same
>way as Tomcat 4.0 does.  Any ideas on that?

I wouldn't like it, and here's why:

1. Tomcat is a servlet/JSP container.  For servlets/JSP, the author is
explicitly responsible for specifying the content type of the response.


2. Technicalities: setContentType() must be called before getWriter() or
getOutputStream().  The servlets/JSPs always get a writer or output
stream if they do anything meaningful.  So the container would have to
set the "default" content-type before getWriter() or getOutputStream()
is called, and before the servlet/JSP has had a chance to set it.  The
container would set it, and then the servlet/JSP would have to set it
again.  This could get confusing and is not natural anyways: the
processing pipeline is cleaner with only one setContentType call per
response instance.

That said, I'm not overwhelmingly against it.  If the setting of a
default content type by the container was a popular request, and
implemented as a configurable thing with the default off to stay
consistent with the spec, it wouldn't be terrible.

I'm interested in where the different behavior comes from between 4.0.x
and 4.1.x.  You're using the same connector?

Yoav Shapira
Millennium ChemInformatics



This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message