| Author |
Content-type without JSP directives
|
Mariusz Skwarczynski
Greenhorn
Joined: Dec 20, 2007
Posts: 3
|
|
Hi, I have this really drive-me-crazy problem with setting content-type. I'm developing a web-site which uses XHTML DOCTYPE. The problem with XHTML is that not all browsers recognize application/xhtml+xml content-type. So I'm using a filter, that is included in web.xml and that changes response's content-type according to Accept header. The problem is that filter changes content-type but something changes it back to text/html. I mean, I know content-type is changed by filter to application/xhtml+html but results in text/html. Any ideas what the something can be?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56178
|
|
|
The browsers rely on the DOCTYPE to determine how to interpret the markup. Just send text/html as the content type.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Mariusz Skwarczynski
Greenhorn
Joined: Dec 20, 2007
Posts: 3
|
|
|
Well, I would rather not rely on browser's choice at least if there's other option.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56178
|
|
You really don't have any choice. The browsers enter their rendering mode based upon the DOCTYPE (or lack thereof). You can muck around with the content type all you want, but it will make no difference. [ December 20, 2007: Message edited by: Bear Bibeault ]
|
 |
 |
|
|
subject: Content-type without JSP directives
|
|
|