tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reynir Hübner <rey...@hugsmidjan.is>
Subject RE: content negotiation with tomcat
Date Tue, 08 Apr 2003 22:00:25 GMT
Hi, 

To answer the first question asked, I would say the easiest way of achiving this, according
to what you are saying is to use Apache to do the content negotiation. The other way to do
it would be by implementing the functionality by using Filters in tomcat, that said I don't
think that this kind of functionality is implemented in the http connectors (coyote) for tomcat
(but maybe Remy can answer that). 

..now to the "off topic" discussion if this is a good concept or not : 
I am not sure I am understanding the whole concept, I really understand why I should do this
with normal URLS ("human readable" and "bookmarkable", urls are good) but I can't understand
why I should want to do this with .gifs or .jpegs, or even any other static content. The reasone
for I am saying this is the fact when I click a link I want to know if I am about to download
a simple jpeg or a webpage or even a pdf. I think that is something the user might want to
know before clicking the link, and I think that is a matter of browseability of a webpage.


The most probable cause for me not understanding the concept is the fact that I cannot read
the page : http://www.w3.org/Provider/Style/URI as I always get some error response "Not Acceptable"....

Maybe someone can clarify this for me ?

Thanx
-reynir




> -----Original Message-----
> From: Jens Skripczynski [mailto:skripi-lists@myrealbox.com] 
> Sent: 8. apríl 2003 21:00
> To: Shapira, Yoav
> Cc: Tomcat Users List; skripi-lists@myrealbox.com
> Subject: Re: content negotiation with tomcat
> 
> 
> Hi,
> 
> 
> Shapira, Yoav:
> > >i just ran over some tips at the w3.org saying url should not have 
> > >content specific endings (like .html, jsp, .gif).
> > 
> > Can you please post the URL to these tips?  I've never heard them 
> > before and don't buy them without further convincing ;)
> The tips is Part of the W3.org Quality Assurance 
> http://www.w3.org/2001/06tips/  (to make the web a better 
> place to surf ... :))
>  
> > I don't know the answer to your question really, as you've left the 
> > definition of "content-negotiation" wide open.  You could, for 
> > example, have a servlet mapped and coded to serve pictures out of 
> > http://yourhost:yourport/yourapp/pictures/x as x.gif
> As far as I understand it, the Client tells the server what 
> kind of files (html, jpg, png) and languages (en, de..) he 
> will accept. The server has a list server-side-mapping and if 
> many mappings are avaible a list of the quality.
> 
> One drawback I have experienced so far is, that this 
> negotiation has no override mode. (I visited 
> http://ini-graphics.net and got the german version but wanted 
> english. their solution was to change the browser 
> configuration which is not too user friendly).
> 
> To me this kind of mapping sounds very reasonable, because i 
> do not have to worry if I change my static html pages to 
> jsp's, that old bookmarks from other people break or I have 
> to setup some URL rewriting engine.
> 
> Has somebody tried something like the W3 QA Team recommends ? 
> Does it make life easier or produce the same amount of sleepless 
>    nights ?
> 
> Pages for reference:
> 
> http://www.w3.org/Provider/Style/URI
> "What to leave out"->"File name extension"
> -------------
>     This is a very common one. "cgi", even ".html" is 
> something which will
>     change. You may not be using HTML for that page in 20 
> years time, but you
>     might want today's links to it to still be valid. The 
> canonical way of 
>     making links to the W3C site doesn't use the extension.
> -------------
> 
> related: http://www.w3.org/Provider/Style/URI#remove
> "How can I remove the file extensions"
> -------------
>    If you are using, for example, Apache, you can set it up 
> to do content
>    negotiation. You keep the file extension (such as .png) on 
> the file (eg
>    mydog.png), but refer to the web resource without it. 
> Apache then checks the
>    directory for all files with that name and any extension, 
> and it can also 
>    pick the best one out of a set (e.g. GIF and PNG). (You do 
> not have to put
>    different types of file in different directories, in fact 
> the content
>    negotiation won't work if you do.)
> 
>    - Set up your server to do content negotiation
>    - Make references always to the URI without the extension
> 
>    References which do have the extension on will still work 
> but will not allow
>    your server to select the best of currently available and 
> future formats.
>    (In fact, mydog, mydog.png and mydog.gif are each valid 
> web resources. mydog
>    is content-type-generic. mydog and mydog.gif are 
> content-type-specific.)
>    Of course, if you are building your own server, then using 
> a database to
>    relate persistent identifiers to their current form is a 
> very clean idea --
>    though beware the unbounded growth of your database.   
> -------------
>  
> 
> For Apache Content Negotiatoin: 
> http://www.apacheweek.com/features/negotiation 
>     "Content 
> Negotiation Explained"
> 
> Ciao
> 
> Jens Skripczynski
> -- 
> E-Mail: skripczynski(at)mail2003(dot)skripczynski(dot)de
> 
> Tollef Fog Heen
> Unix _IS_ user friendly... It's just selective about who its 
> friends are.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message