You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jozsa Kristof <dy...@kami.vein.hu> on 2002/02/04 18:41:15 UTC

serving images?

Ok, here's a trivial question: how do I serve image files using Cocoon?

I have some html tag in the results of some page, like:
<img border="0" src="/images/company/wtf.jpg">

and in the sitemap's main pipeline (the reader is configured at the top):
<map:match pattern="images/**.jpg">
  <map:read src="/images/{1}.jpg" mime-type="image/jpg"/>
</map:match>


The docs says that's enough, I think this should be enough too. The logs
says: 'org.apache.cocoon.ResourceNotFoundException: Resource not found
file:/images/company/wtf.jpg'. 

What do I miss from here?

Thanks,
Christopher
-- 
.Digital.Yearning.for.Networked.Assassination.and.Xenocide

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: serving images?

Posted by Jozsa Kristof <dy...@kami.vein.hu>.
On Mon, Feb 04, 2002 at 01:48:22PM -0500, Vadim Gritsenko wrote:
> > From: Jozsa Kristof [mailto:dynax@kami.vein.hu]
> > 
> > Ok, here's a trivial question: how do I serve image files using
> Cocoon?
> > 
> > I have some html tag in the results of some page, like:
> > <img border="0" src="/images/company/wtf.jpg">
> > 
> > and in the sitemap's main pipeline (the reader is configured at the
> top):
> > <map:match pattern="images/**.jpg">
> >   <map:read src="/images/{1}.jpg" mime-type="image/jpg"/>
> > </map:match>
> > 
> > 
> > The docs says that's enough, I think this should be enough too. The
> logs
> > says: 'org.apache.cocoon.ResourceNotFoundException: Resource not found
> > file:/images/company/wtf.jpg'.
> > 
> > What do I miss from here?
> 
> Do you have /images directory at the root of the file system?
> Or, if images are located in context directory, try without leading
> slash:
> 
>    <map:read src="images/{1}.jpg" mime-type="image/jpg"/>

You're correct (as usual :). For some reason I thought / means the root of
the virtual host context, not the root of my filesystem.

Thanks Vadim,

Christopher
-- 
.Digital.Yearning.for.Networked.Assassination.and.Xenocide

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: serving images?

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Jozsa Kristof [mailto:dynax@kami.vein.hu]
> 
> Ok, here's a trivial question: how do I serve image files using
Cocoon?
> 
> I have some html tag in the results of some page, like:
> <img border="0" src="/images/company/wtf.jpg">
> 
> and in the sitemap's main pipeline (the reader is configured at the
top):
> <map:match pattern="images/**.jpg">
>   <map:read src="/images/{1}.jpg" mime-type="image/jpg"/>
> </map:match>
> 
> 
> The docs says that's enough, I think this should be enough too. The
logs
> says: 'org.apache.cocoon.ResourceNotFoundException: Resource not found
> file:/images/company/wtf.jpg'.
> 
> What do I miss from here?

Do you have /images directory at the root of the file system?
Or, if images are located in context directory, try without leading
slash:

   <map:read src="images/{1}.jpg" mime-type="image/jpg"/>


Vadim


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>