tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: TC6 ${CATALINA_HOME}/conf/web.xml Is this the place to constrain the mime type?
Date Thu, 05 Feb 2009 18:28:33 GMT
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> Subject: TC6 ${CATALINA_HOME}/conf/web.xml Is this the place
> to constrain the mime type?
>
> I want to 'reject' (if that's the right word) any http get
> with mime type != application/xml

Do you mean .html and .jsp are not valid?  That might make life interesting.  It will be difficult
to stop clients from accepting at least text/html in addition to application/xml.

> I see in web.xml in the conf directory
>  <mime-mapping>
>         <extension>xml</extension>
>         <mime-type>application/xml</mime-type>
>     </mime-mapping>
> Is this the right place to do it please?

No - that would pretty much certainly break things.  Also, AFAIK, that's only used for responses,
so that the container can set the mime type properly for whatever resource is being returned.

You probably need to do this in a filter that will see the request before your servlets do.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

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


Mime
View raw message