cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: something that bugs me
Date Tue, 13 Nov 2001 15:55:17 GMT
Sebastien Koechlin a écrit :
> 
> I did not receive any answer about my last message about this.
> 
> >    <map:match pattern="**images/*.png">
> >     <map:read src="images/{2}.png" mime-type="image/png"/>
> >    </map:match>
> >
> >    <map:match pattern="**images/*.jpg">
> >     <map:read src="images/{2}.jpg" mime-type="image/jpeg"/>
> >    </map:match>
> >
> >    <map:match pattern="**images/*.gif">
> >     <map:read src="images/{2}.gif" mime-type="image/gif"/>
> >    </map:match>
> 
> What about
> 
>         <map:match pattern="**images/*">
>                 <map:read src="images/{2}"/>
>         </map:match>
> 
> with the help of a file to map content-type according to
> filename extention ?
> 
> Is it possible to use a mapping when the mime-type attribute
> does not exist ?
> 
> Such mapping is already written in xml form in
>         $TOMCAT_HOME/conf/web.xml
> 

This is already how Cocoon works !

If you don't specify a mime-type in map:read, the ResourceReader asks
the environment context for a mime type for the resource using
getMimeType(). This method uses the builtin mime type definitions of the
servlet container and those defined in web.xml to search for an
appropriate mime type.

Sylvain.

> --
> Sébastien Koechlin - IVision - skoechlin@ivision.fr
> 

-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message