cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] ServingStaticFiles Fri Jun 6 20:00:02 2003
Date Fri, 06 Jun 2003 18:00:02 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=ServingStaticFiles , version: 10 on Fri Jun 
6 17:50:11 2003 by JoergHeinicke

- !!!HOW-TO Serve static files such as images, CSS stylesheets, etc.
? -   ^^^^^ ^

+ !!How to serve static files such as images, CSS stylesheets, etc.?
?    ^^ ^^^^                                                       +

- By default a web server will serve up any file that can be found under its Document Root.
Therefore if it serves a web page that references additional images, applets or other supporting
media then, as long as those files can be found under the Document Root, it'll serve them
when the browser requests them.
?                                                                            ^        ^  
                                                                                         
                                                                   ^        ^

+ By default a web server will serve up any file that can be found under its document root.
Therefore if it serves a web page that references additional images, applets or other supporting
media then, as long as those files can be found under the document root, it'll serve them
when the browser requests them.
?                                                                            ^        ^  
                                                                                         
                                                                   ^        ^

- However Cocoon's default mode of operation is different: unless there is an explicit [Pipeline]
that instructs Cocoon on how to respond to a particular request and serve the required file,
then there will be a 'resource not found' error.
+ However Cocoon's default mode of operation is different: unless there is an explicit [Pipeline]
that instructs Cocoon on how to respond to a particular request and serve the required file,
then there will be a 'resource not found' or a 'no pipeline matched request' error.
?                                                                                        
                                                                                         
                                                     +++++++++++++++++++++++++++++++++++

- So, in short, a web server 'knows' how to serve files automatically. Cocoon doesn't, so
you have to map the request to the file system using a [Pipeline]. 
?                                                                                        
                                                                  -

+ So, in short, a web server 'knows' how to serve files automatically. Cocoon doesn't, so
you have to map the request to the file system using a [Pipeline].
+ <map:match pattern="static-**.html">
+    <map:read src="html/{1}.html" mime-type="text/html"/>
+ </map:match>
- 
- ----
- Note: the [Reader] method won't work for a static HTML document.  You will still need to
use a [Generator] and a [Serializer].
- ----
- Note: I've used this method to serve static HTML files, like this;
- {{{
- <map:match pattern="">
-    <map:read src="html/index.html" mime-type="text/html"/>
- </map:match>
- }}}
- ----



Mime
View raw message