permaculture playing cards*
The moose likes Tomcat and the fly likes Does Tomcat send content-type using a strange format in header?   (Can I change this?) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Does Tomcat send content-type using a strange format in header?   (Can I change this?)" Watch "Does Tomcat send content-type using a strange format in header?   (Can I change this?)" New topic
Author

Does Tomcat send content-type using a strange format in header? (Can I change this?)

Tetsuya Suga
Greenhorn

Joined: Jan 14, 2009
Posts: 2
Hello,

First, I'm sorry for my poor English...


My Tomcat send content-type like this:
Content-Type: text/xml;charset=UTF-8


The separator is ";" now.
But Apache's separator is "; ".

So I want to change it from ";" to "; ", because some of clients which is made very strictly don't understand the content-type and don't work well.


In order to change, which file should I edit?

Please tell me the way.


Thank you.
Tetsuya
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I can't see how Tomcat would be automatically responding with the text/xml content type. Is this response from one of your servlets, or something plugged in to Tomcat?
In theory you should be able to override the content type and include the space and Tomcat should accept the change.
Tetsuya Suga
Greenhorn

Joined: Jan 14, 2009
Posts: 2
Hello,

Thank you for reply.

>>I can't see how Tomcat would be automatically responding with the text/xml content type.
Tomcat send using ";" not only in text/xml, but also in other types. like:
Content-Type: text/html;charset=iso-8859-1
Content-Type: text/plain;charset=UTF-8



And I'm using tomcat5.5 provided from Alfresco ( open source ECM ).
I first thought the Alfresco's setting caused this, but now I don't think so.
Because Tomcat send me content-type using ";" when Tomcat shows "HTTP states 404 - /manager/". The error pages like 404 or 500 are displayed by Tomcat itself ,not my webapps.

Maybe my tomcat is customized for alfresco. And that is the reason, maybe.

How can I check the configuration? Which file the declaration is written in?


Thank you.


Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Tetsuya Suga wrote:because some of clients which is made very strictly don't understand the content-type and don't work well
This has nothing to do with strictness. It's a bug in the client used.

Which clients are you talking about? Name them.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does Tomcat send content-type using a strange format in header? (Can I change this?)