> -----Original Message-----
> From: Phil Coultard [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 30, 2003 7:04 AM
> To: [EMAIL PROTECTED]
> Subject: Newbie: Ok I've got it installed but can't get a new stand
> alone application to run
>

<snip/>

> Following Geoff's advice I have read the enclosed documentation and looked
> on http://wiki.cocoondev.org. However both sources seem to concentrate on
> the concepts and skip the more basic set-up procedures... Using these two
> sources I have set up "work" as a sub-dir of mount and put in it
> two files:
> sitemap.xmap and home.html, the source for which is shown below. When I
> browse to http://localhost:8080/cocoon/mount/work/ I receive the following
> message:

Ok, good way to get started playing around.

>
> Cocoon 2 - Resource not found
> ------------------------------------------------------------------
> type resource-not-found
> message Resource not found
> description The requested URI "/cocoon/mount/work/home.html" was
> not found.
> sender org.apache.cocoon.servlet.CocoonServlet
> source Cocoon servlet
> request-uri
> /cocoon/mount/work/home.html
> path-info
> mount/work/home.html
>
> I can see that it clearly is getting as far as looking for the file
> home.html in the root folder of the app but I don't understand why it
> doesn't find it: it is there! Clearly I'm missing a point somewhere...

Yes, see below.

> ------------------------------------------------------------------
> sitemap.xmap
> ------------------------------------------------------------------
> <?xml version="1.0"?>
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>
>
>   <map:components>
>     <map:generators   default="file"/>
>     <map:transformers default="xslt"/>
>     <map:readers      default="resource"/>
>     <map:serializers  default="html"/>
>     <map:matchers default="wildcard"/>
>   </map:components>
>
>   <map:pipelines>
>   <map:pipeline>
>    <map:match pattern="">
>      <map:redirect-to uri="home.html"/>
>    </map:match>

<!-- You need a match for pattern="home.html".  Cocoon never automatically
        maps uris to actual resources on disk without an appropriate matcher. -->

     <!-- read html and stream it directly, bypassing cocoon's sax
pipeline -->
     <map:match pattern="home.html">
        <map:read mime-type="text/html" src="home.html">
     </map:match>

<!-- OR -->

        <!-- parse html as xml using the file generator.  you can add
transformer(s) and
                serializer as you like here, but if your html is not well-formed xml,
                the processing will fail -->
     <map:match pattern="home.html">
          <map:generate src="home.html"/>
          <!--map:transform src="your_transform.xsl"/-->
        <map:serialize/>
     </map:match>

<!-- OR -->
        <!-- use Tidy to parse html and make it well-formed xml -->
     <map:match pattern="home.html">
          <map:generate type="html" src="home.html"/>
          <!--map:transform src="your_transform.xsl"/-->
        <map:serialize/>
     </map:match>

<!-- Note: to use pattern matching to serve all html in that dir in the same
way,
        change the match to pattern="*.html" and use src="{1}.html" in your
generator/reader. -->
>
> </map:pipeline>
>
>   </map:pipelines>
> </map:sitemap>

Hope that helps,

Geoff

>
> ------------------------------------------------------------------
> home.html
> ------------------------------------------------------------------
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>
> <html>
> <head>
>       <title>Untitled</title>
> </head>
>
> <body>
> Hi There!
>
>
> </body>
> </html>
> ---


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to