You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ovidiu Predescu <ov...@cup.hp.com> on 2000/10/03 09:05:19 UTC

browser handling in C1/C2

Hi,

I've been reading the C2 sources this evening, looking to see how different
browser types are handled in C2. To my surprise I discovered that it uses the
same (in my opinion broken) way as C1 of assigning media types based on the
user agent string passed in the HTTP request.

I was under the impression that a much cleaner way that takes into account the
Accept: header is going to replace the C1 way of setting the content type of
the result.

The reason I'm asking is because I'd like to experiment, in C1 for now, with a
different way of determining the media type, essentially based on the Accept:
header. The main motivation for doing this is to handle the explosion of WAP
devices out there, each one requiring an entry in the cocoon.properties file,
which is clearly not a scalable solution.

The idea is to use the user agent to determine the media type or, in case this
is not present in the list of user agents, to use the Accept: header to
determine a generic one.

Any thoughts on this?

Thanks,
Ovidiu

-- 
Ovidiu Predescu <ov...@cup.hp.com>
http://orion.nsr.hp.com/ (inside HP's firewall only)
http://www.geocities.com/SiliconValley/Monitor/7464/



Re: browser handling in C1/C2

Posted by Stefano Mazzocchi <st...@apache.org>.
Ovidiu Predescu wrote:
> 
> Hi,
> 
> I've been reading the C2 sources this evening, looking to see how different
> browser types are handled in C2. To my surprise I discovered that it uses the
> same (in my opinion broken) way as C1 of assigning media types based on the
> user agent string passed in the HTTP request.
> 
> I was under the impression that a much cleaner way that takes into account the
> Accept: header is going to replace the C1 way of setting the content type of
> the result.

The way browser type are handled is pluggable... so simply create the
matcher/selector you like the most and submit it to us :)

We are very lazy in case you didn't notice :)
 
> The reason I'm asking is because I'd like to experiment, in C1 for now, with a
> different way of determining the media type, essentially based on the Accept:
> header. The main motivation for doing this is to handle the explosion of WAP
> devices out there, each one requiring an entry in the cocoon.properties file,
> which is clearly not a scalable solution.

I've been told this is not a viable solutions since almost all WAP
phones forget to send the appropriate Accept: headers... but I won't
stop you from trying :)

> The idea is to use the user agent to determine the media type or, in case this
> is not present in the list of user agents, to use the Accept: header to
> determine a generic one.

I like it, go for it.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------