You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christian Gorbach <go...@gmx.at> on 2008/03/07 09:43:47 UTC

T5: Response Content Type, Web Standards and IE

hi group,

I'm trying to achive to let T5 server xhtml valid pages. This seems to 
be easy, because T5 uses a DOM (this is really great) and different 
markup writers can render out different markup styles (e.g. html vs xhtml).
The html markup writer is the default markup writer, to use a xml writer 
you can add a @ContentType annotation to your page(s).

http://www.w3.org/TR/xhtml-media-types/:
<quote>
'application/xhtml+xml' SHOULD be used for serving
XHTML documents to XHTML user agents.  Authors who wish to support
both XHTML and HTML user agents MAY utilize content
negotiation by serving HTML documents as 'text/html' and XHTML documents
as  'application/xhtml+xml'.  Also note that it is not necessary
for XHTML documents served as 'application/xhtml+xml' to follow
the HTML Compatibility Guidelines.
</quote>

BUT: @ContentType("application/xhtml+xml") is only respected by Mozilla 
Browsers. IE doesnt know how to handle responses of this content type. 
Same behavior for "text/xml".
Content negotation also isn't an option, because the annotation is too 
static and applies to all user agents. For IE et al. my markup should be 
rendered as valid xhtml and the content type should be classic "text/html".

Any ideas how to choose the xml markup writer in conjunction with 
response content type "text/html"?

tia & best regards
c)hristian









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


Re: T5: Response Content Type, Web Standards and IE

Posted by Christian Gorbach <go...@gmx.at>.
Francois Armand schrieb:
> Kristian Marinkovic a écrit :
>> havent tried myself, but it should work this way...
>>
>> you could create a Dispatcher and inject the Request service.
>> by analyzing the http headers you can determine the client and set 
>> the content-type of the response accordingly
>>   
> I think that the problem here is if Tapestry see "text/html", it 
> switches to its SGML renderer and so the input is not longer valid 
> XHTML (it's valid HTML).
> Perhaps I misunderstood, but I believe that Christian
>    1/ want to render valid XHTML
>    2/ have to use "text/html" content type.
>
Yes, Francois - you are right. sgml markup writer is used when text/html 
is set. That's the problem...

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


Re: T5: Response Content Type, Web Standards and IE

Posted by Francois Armand <fa...@linagora.com>.
Kristian Marinkovic a écrit :
> havent tried myself, but it should work this way...
>
> you could create a Dispatcher and inject the Request service.
> by analyzing the http headers you can determine the client and 
> set the content-type of the response accordingly
>   
I think that the problem here is if Tapestry see "text/html", it 
switches to its SGML renderer and so the input is not longer valid XHTML 
(it's valid HTML).
Perhaps I misunderstood, but I believe that Christian
    1/ want to render valid XHTML
    2/ have to use "text/html" content type.

-- 
Francois Armand
Etudes & Développements J2EE
Groupe Linagora - http://www.linagora.com
Tél.: +33 (0)1 58 18 68 28
-----------
InterLDAP - http://interldap.org 
FederID - http://www.federid.org/
Open Source identities management and federation


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


Re: T5: Response Content Type, Web Standards and IE

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
havent tried myself, but it should work this way...

you could create a Dispatcher and inject the Request service.
by analyzing the http headers you can determine the client and 
set the content-type of the response accordingly

g,
kris




Christian Gorbach <go...@gmx.at> 
07.03.2008 09:43
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
Tapestry users <us...@tapestry.apache.org>
Kopie

Thema
T5: Response Content Type, Web Standards and IE







hi group,

I'm trying to achive to let T5 server xhtml valid pages. This seems to 
be easy, because T5 uses a DOM (this is really great) and different 
markup writers can render out different markup styles (e.g. html vs 
xhtml).
The html markup writer is the default markup writer, to use a xml writer 
you can add a @ContentType annotation to your page(s).

http://www.w3.org/TR/xhtml-media-types/:
<quote>
'application/xhtml+xml' SHOULD be used for serving
XHTML documents to XHTML user agents.  Authors who wish to support
both XHTML and HTML user agents MAY utilize content
negotiation by serving HTML documents as 'text/html' and XHTML documents
as  'application/xhtml+xml'.  Also note that it is not necessary
for XHTML documents served as 'application/xhtml+xml' to follow
the HTML Compatibility Guidelines.
</quote>

BUT: @ContentType("application/xhtml+xml") is only respected by Mozilla 
Browsers. IE doesnt know how to handle responses of this content type. 
Same behavior for "text/xml".
Content negotation also isn't an option, because the annotation is too 
static and applies to all user agents. For IE et al. my markup should be 
rendered as valid xhtml and the content type should be classic 
"text/html".

Any ideas how to choose the xml markup writer in conjunction with 
response content type "text/html"?

tia & best regards
c)hristian









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