Dont know Apache in that detail, possibly a guru maybe able to fix the way you attempting, but I think it should be relatively easy to add a filter to tomcat to do that.... there you can intercept both request and response. ie intercept the request, if browser let it go, if XSLT engine, pretent to be XML. Very easy I think.

----- Original Message ----- From: "Richard Kaye" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Thursday, June 21, 2007 5:04 PM
Subject: using mod_jk: how to set content-type


Hi

I am using Tomcat5.5, Apache2.2 and mod_jk1.2
and a third-part servlet which I can't re-program or
configure.

I need to sniff the HTTP "User-Agent" and/or "Accept"
fields and change the content-type
(currently "text/html;charset=UTF-8") that the
servlet returns based on these.

using mod_headers and mod_setenvif, I currently
have (in my apache2 config) something like:

   SetEnvIf User-Agent Whatever DETECTED1
   SetEnvIf Accept Somethingelse DETECTED2
   JkMount /servletname/* ajp13_worker
   <LocationMatch /servletname/* >
       Header set Content-Type "text/xml" env=DETECTED1
       Header set Content-Type "application/xml" env=DETECTED2
   </LocationMatch>

Unfortunately, it doesn't work. Specifically, I always get the
document served as "Content-Type: text/html;charset=UTF-8"
and not "Content-Type: text/xml" as expected. From googling a bit
I have learnt that the mod_headers module won't set the Content-Type
header, because this one is set internally by apache at a later stage.
But I couldn't find a workaround or alternative that does what I want.

Help please!

And many thanks...

Richard


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to