tomcat-users mailing list archives

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

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). 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 : as I always get some error response "Not Acceptable"....

Maybe someone can clarify this for me ?


> -----Original Message-----
> From: Jens Skripczynski [] 
> Sent: 8. apríl 2003 21:00
> To: Shapira, Yoav
> Cc: Tomcat Users List;
> Subject: Re: content negotiation with tomcat
> Hi,
> Shapira, Yoav:
> > >i just ran over some tips at the 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 Quality Assurance 
>  (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 
> 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:
> "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:
> "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: 
>     "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:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message