You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tibi DONDERA <ti...@hotmail.com> on 2001/08/22 16:31:06 UTC

Re: can't match images in sitemap

IMHO,

Your configuration seems right. I bet that using

<cocoon address>/images/my_image.jpg
will give you the image.

But the tag that is in your page should be <img
src="../images/my_image.jpg">
After all, the URL of the page is

<cocoon address>/pages/my_page.html,

right?

Hope this helps.


----- Original Message -----
From: "Chris Newland" <ch...@emorphia.com>
To: "Cocoon-Users" <co...@xml.apache.org>
Sent: Wednesday, August 22, 2001 4:10 PM
Subject: C2: can't match images in sitemap


> Hi All,
>
> I'm trying to add a map:match to my sitemap to fetch images but they are
not
> fetched (my fault, Cocoon2 is working great)
>
> Location of my files:
>
> tomcat/webapps/cocoon/docs/samples/pages/my_page.xsp
> tomcat/webapps/cocoon/docs/samples/images/my_image.jpg
> tomcat/webapps/cocoon/stylesheets/my_xsl.xsl
>
> sitemap entries:
>
> <map:match pattern="pages/*">
> <map:generate type="serverpages" src="docs/samples/pages/{1}.xsp"/>
> <map:transform src="stylesheets/my_xsl"/>
> </map:match>
>
> (loads + processes XSP page fine)
>
> <map:match pattern="images/**.jpg">
> <map:read src="docs/samples/images/{1}.jpg" mime-type="image/jpg"/>
> </map:match>
>
> (does not return the image)
>
> The returned HTML contains:
>
> <img src="images/my_image.jpg">
>
> As far as I can see, this is the same way that the cocoon.gif image is
> fetched from samples.xml but I can't see what I'm doing wrong.
>
> Any help would be appreciated.
>
> Thanks,
>
> Chris
>
> --
> Chris Newland
> Software Research Engineer
>
> Emorphia Ltd
> Registered in England.  4133002
> Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK
>
> Email: chris.newland@emorphia.com
> Tel: +44 (0)1279 450100
> Fax: +44 (0)1279 450102
>
> Check out FIPA-OS at http://fipa-os.sourceforge.net/
>
> This message may contain information proprietary to Emorphia so any
> unauthorised disclosure, copying or distribution of its contents is
strictly
> prohibited.
>
>
>
> ---------------------------------------------------------------------
> 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>
>
>

---------------------------------------------------------------------
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: can't match images in sitemap

Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
If you have all your images in one directory (%context%/images) then you can
use this:

<map:match pattern="**/*.jpg">
    <map:read src="context://images/{2}.jpg" mime-type="image/jpeg"/>
</map:match>

This will redirect all requests like:
docs/samples/pages/images/img.jpg  <-- this is what you get with your src
attribute

to %context%/images

This is not a good solution, but it works and you can use simply <img
src="images/img.jpg" /> everywhere. But if you want to classify your images
by directories then you will need something else...

Regards,
    Konstantin Piroumian

> Thanks everyone,
>
> Accessing the images directly works fine and so does prefixing the url
with
> ../ (path back to webapp root) but my understanding was that the sitemap
> provided a total abstraction between the url fetched by the browser
> "images/my_image.jpg" and the actual file on disk.
>
> Prefixing my URLs so that they are relative to the current page seems a
> little hardcoded to me.
>
> Isn't the request for the image processed by the sitemap?
>
> Thanks,
>
> Chris
>
> > -----Original Message-----
> > From: Tibi DONDERA [mailto:tibidondera@hotmail.com]
> > Sent: 22 August 2001 15:31
> > To: cocoon-users@xml.apache.org
> > Subject: Re: can't match images in sitemap
> >
> >
> > IMHO,
> >
> > Your configuration seems right. I bet that using
> >
> > <cocoon address>/images/my_image.jpg
> > will give you the image.
> >
> > But the tag that is in your page should be <img
> > src="../images/my_image.jpg">
> > After all, the URL of the page is
> >
> > <cocoon address>/pages/my_page.html,
> >
> > right?
> >
> > Hope this helps.
> >
> >
> > ----- Original Message -----
> > From: "Chris Newland" <ch...@emorphia.com>
> > To: "Cocoon-Users" <co...@xml.apache.org>
> > Sent: Wednesday, August 22, 2001 4:10 PM
> > Subject: C2: can't match images in sitemap
> >
> >
> > > Hi All,
> > >
> > > I'm trying to add a map:match to my sitemap to fetch images but they
are
> > not
> > > fetched (my fault, Cocoon2 is working great)
> > >
> > > Location of my files:
> > >
> > > tomcat/webapps/cocoon/docs/samples/pages/my_page.xsp
> > > tomcat/webapps/cocoon/docs/samples/images/my_image.jpg
> > > tomcat/webapps/cocoon/stylesheets/my_xsl.xsl
> > >
> > > sitemap entries:
> > >
> > > <map:match pattern="pages/*">
> > > <map:generate type="serverpages" src="docs/samples/pages/{1}.xsp"/>
> > > <map:transform src="stylesheets/my_xsl"/>
> > > </map:match>
> > >
> > > (loads + processes XSP page fine)
> > >
> > > <map:match pattern="images/**.jpg">
> > > <map:read src="docs/samples/images/{1}.jpg" mime-type="image/jpg"/>
> > > </map:match>
> > >
> > > (does not return the image)
> > >
> > > The returned HTML contains:
> > >
> > > <img src="images/my_image.jpg">
> > >
> > > As far as I can see, this is the same way that the cocoon.gif image is
> > > fetched from samples.xml but I can't see what I'm doing wrong.
> > >
> > > Any help would be appreciated.
> > >
> > > Thanks,
> > >
> > > Chris
> > >
> > > --
> > > Chris Newland
> > > Software Research Engineer
> > >
> > > Emorphia Ltd
> > > Registered in England.  4133002
> > > Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK
> > >
> > > Email: chris.newland@emorphia.com
> > > Tel: +44 (0)1279 450100
> > > Fax: +44 (0)1279 450102
> > >
> > > Check out FIPA-OS at http://fipa-os.sourceforge.net/
> > >
> > > This message may contain information proprietary to Emorphia so any
> > > unauthorised disclosure, copying or distribution of its contents is
> > strictly
> > > prohibited.
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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>
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > 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>
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> 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>
>

---------------------------------------------------------------------
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>


[C1] NPE with XInclude

Posted by Drasko Kokic <dr...@yahoo.com>.
My environment is: Cocoon 1.8.2, TC 3.2.3, JDK 1.3.1,
WinNT 4.0

I would like to include an XML document via the
following code:

<include xinclude:parse="xml"
xinclude:href="http://..." />

and am getting the following exception:

java.lang.NullPointerException
              at
java.net.URLConnection.stripOffParameters(URLConnection.java:1016)
              at
java.net.URLConnection.getContentHandler(URLConnection.java:984)
              at
java.net.URLConnection.getContent(URLConnection.java:559)
              at java.net.URL.getContent(URL.java:812)
              at
org.apache.cocoon.processor.xinclude.XIncludeProcessor$XIncludeProcessorWorker.processXIncludeElement(XIncludeProcessor.java:318)
              at
org.apache.cocoon.processor.xinclude.XIncludeProcessor$XIncludeProcessorWorker.process(XIncludeProcessor.java:227)
              at
org.apache.cocoon.processor.xinclude.XIncludeProcessor.process(XIncludeProcessor.java:139)
              at
org.apache.cocoon.Engine.handle(Engine.java:384)
              at
org.apache.cocoon.Cocoon.service(Cocoon.java:183)
              at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

Is this a bug or I am using the XInclude processor in
some wrong way?!

TIA
Drasko

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

---------------------------------------------------------------------
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: can't match images in sitemap

Posted by Luca Morandini <l....@tin.it>.
Chris,

	there is a FAQ entry on this at the Cocoon2 site (it works only on Apache,
though...).

Best regards,


---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
            +39 0744 59 85 1 Office
            +39 0335 681 02 12 Mobile
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------


> -----Original Message-----
> From: Chris Newland [mailto:chris.newland@emorphia.com]
> Sent: Wednesday, August 22, 2001 5:31 PM
> To: cocoon-users@xml.apache.org
> Subject: RE: can't match images in sitemap
>
>
> Ok, thanks all, this is much clearer now.
>
> btw, is there any way to remove "cocoon" from the URL, I guess this is a
> tomcat configuration issue so I'll have a look in there first.
>
> thanks,
>
> Chris
>
> > -----Original Message-----
> > From: java guru [mailto:javacocoon@yahoo.co.in]
> > Sent: 22 August 2001 16:08
> > To: cocoon-users@xml.apache.org
> > Subject: RE: can't match images in sitemap
> >
> >
> > Yes.,
> >   there is abstraction between the url and actual
> > location of the files on the disk...But from my
> > understanding what the situation is..
> >
> > 1. If you have sent over html to browser with image
> > link as "/images/image1.jpg" and that html url is
> > "http://localhost:8080/cocoon/welcome"..
> >
> > 2. When the browser sends request back to server, the
> > request for image is formed like
> > "http://localhost:8080/images/image1.jpg"..this is
> > something browser did..
> >
> > 3. When the request hits the server, thr url doesnt
> > fall under category of url to be forwarded to
> > cocoon..and hence the web server(tomcat) try to handle
> > by itself(or root web application)..which would not
> > find the file obviously..
> >
> > 4. Now on the page of
> > "http://localhost:8080/cocoon/welcome/intro" if u have
> > image with "images/image1.gif" the request from
> > browser for image is formed like
> > "http://localhost:8080/cocoon/welcome/images/image1.jpg"..
> >
> > 5. Now once this request hits the server, the request
> > if forwarded to cocoon by the container, by this time
> > the uri becomes "welcom/images/image1.jpg" as it
> > entered to "cocoon" context..
> >
> > 6. This resulted uri is passed thru the "mathers" and
> > if u have match saying "
> > pattern="images/*.jpg"..obviously the requested uri
> > doesnt match with the specified pattern..
> >
> > 7. This has nothing to do with abstraction between uri
> > and actual file..This has to do with the way url are
> > handled by browser
> >
> >  --- Chris Newland <ch...@emorphia.com> wrote:
> > > Thanks everyone,
> > >
> > > Accessing the images directly works fine and so does
> > > prefixing the url with
> > > ../ (path back to webapp root) but my understanding
> > > was that the sitemap
> > > provided a total abstraction between the url fetched
> > > by the browser
> > > "images/my_image.jpg" and the actual file on disk.
> > >
> > > Prefixing my URLs so that they are relative to the
> > > current page seems a
> > > little hardcoded to me.
> > >
> > > Isn't the request for the image processed by the
> > > sitemap?
> > >
> > > Thanks,
> > >
> > > Chris
> > >
> > > > -----Original Message-----
> > > > From: Tibi DONDERA
> > > [mailto:tibidondera@hotmail.com]
> > > > Sent: 22 August 2001 15:31
> > > > To: cocoon-users@xml.apache.org
> > > > Subject: Re: can't match images in sitemap
> > > >
> > > >
> > > > IMHO,
> > > >
> > > > Your configuration seems right. I bet that using
> > > >
> > > > <cocoon address>/images/my_image.jpg
> > > > will give you the image.
> > > >
> > > > But the tag that is in your page should be <img
> > > > src="../images/my_image.jpg">
> > > > After all, the URL of the page is
> > > >
> > > > <cocoon address>/pages/my_page.html,
> > > >
> > > > right?
> > > >
> > > > Hope this helps.
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Chris Newland" <ch...@emorphia.com>
> > > > To: "Cocoon-Users" <co...@xml.apache.org>
> > > > Sent: Wednesday, August 22, 2001 4:10 PM
> > > > Subject: C2: can't match images in sitemap
> > > >
> > > >
> > > > > Hi All,
> > > > >
> > > > > I'm trying to add a map:match to my sitemap to
> > > fetch images but they are
> > > > not
> > > > > fetched (my fault, Cocoon2 is working great)
> > > > >
> > > > > Location of my files:
> > > > >
> > > > >
> > > tomcat/webapps/cocoon/docs/samples/pages/my_page.xsp
> > > > >
> > >
> > tomcat/webapps/cocoon/docs/samples/images/my_image.jpg
> > > > > tomcat/webapps/cocoon/stylesheets/my_xsl.xsl
> > > > >
> > > > > sitemap entries:
> > > > >
> > > > > <map:match pattern="pages/*">
> > > > > <map:generate type="serverpages"
> > > src="docs/samples/pages/{1}.xsp"/>
> > > > > <map:transform src="stylesheets/my_xsl"/>
> > > > > </map:match>
> > > > >
> > > > > (loads + processes XSP page fine)
> > > > >
> > > > > <map:match pattern="images/**.jpg">
> > > > > <map:read src="docs/samples/images/{1}.jpg"
> > > mime-type="image/jpg"/>
> > > > > </map:match>
> > > > >
> > > > > (does not return the image)
> > > > >
> > > > > The returned HTML contains:
> > > > >
> > > > > <img src="images/my_image.jpg">
> > > > >
> > > > > As far as I can see, this is the same way that
> > > the cocoon.gif image is
> > > > > fetched from samples.xml but I can't see what
> > > I'm doing wrong.
> > > > >
> > > > > Any help would be appreciated.
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Chris
> > > > >
> > > > > --
> > > > > Chris Newland
> > > > > Software Research Engineer
> > > > >
> > > > > Emorphia Ltd
> > > > > Registered in England.  4133002
> > > > > Mill House, Station Approach, Harlow Mill,
> > > Harlow, Essex, CM20 2EL, UK
> > > > >
> > > > > Email: chris.newland@emorphia.com
> > > > > Tel: +44 (0)1279 450100
> > > > > Fax: +44 (0)1279 450102
> > > > >
> > > > > Check out FIPA-OS at
> > > http://fipa-os.sourceforge.net/
> > > > >
> > > > > This message may contain information proprietary
> > > to Emorphia so any
> > > > > unauthorised disclosure, copying or distribution
> > > of its contents is
> > > > strictly
> > > > > prohibited.
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> > ---------------------------------------------------------------------
> > > > > 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>
> > > > >
> > > > >
> > > >
> > > >
> > >
> > ---------------------------------------------------------------------
> > > > 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>
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > 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>
> > >
> >
> > =====
> > Thanks and have great day
> > srini
> >
> > ____________________________________________________________
> > Do You Yahoo!?
> > For regular News updates go to http://in.news.yahoo.com
> >
> > ---------------------------------------------------------------------
> > 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>
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> 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>
>


---------------------------------------------------------------------
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: can't match images in sitemap

Posted by Chris Newland <ch...@emorphia.com>.
Ok, thanks all, this is much clearer now.

btw, is there any way to remove "cocoon" from the URL, I guess this is a
tomcat configuration issue so I'll have a look in there first.

thanks,

Chris

> -----Original Message-----
> From: java guru [mailto:javacocoon@yahoo.co.in]
> Sent: 22 August 2001 16:08
> To: cocoon-users@xml.apache.org
> Subject: RE: can't match images in sitemap
>
>
> Yes.,
>   there is abstraction between the url and actual
> location of the files on the disk...But from my
> understanding what the situation is..
>
> 1. If you have sent over html to browser with image
> link as "/images/image1.jpg" and that html url is
> "http://localhost:8080/cocoon/welcome"..
>
> 2. When the browser sends request back to server, the
> request for image is formed like
> "http://localhost:8080/images/image1.jpg"..this is
> something browser did..
>
> 3. When the request hits the server, thr url doesnt
> fall under category of url to be forwarded to
> cocoon..and hence the web server(tomcat) try to handle
> by itself(or root web application)..which would not
> find the file obviously..
>
> 4. Now on the page of
> "http://localhost:8080/cocoon/welcome/intro" if u have
> image with "images/image1.gif" the request from
> browser for image is formed like
> "http://localhost:8080/cocoon/welcome/images/image1.jpg"..
>
> 5. Now once this request hits the server, the request
> if forwarded to cocoon by the container, by this time
> the uri becomes "welcom/images/image1.jpg" as it
> entered to "cocoon" context..
>
> 6. This resulted uri is passed thru the "mathers" and
> if u have match saying "
> pattern="images/*.jpg"..obviously the requested uri
> doesnt match with the specified pattern..
>
> 7. This has nothing to do with abstraction between uri
> and actual file..This has to do with the way url are
> handled by browser
>
>  --- Chris Newland <ch...@emorphia.com> wrote:
> > Thanks everyone,
> >
> > Accessing the images directly works fine and so does
> > prefixing the url with
> > ../ (path back to webapp root) but my understanding
> > was that the sitemap
> > provided a total abstraction between the url fetched
> > by the browser
> > "images/my_image.jpg" and the actual file on disk.
> >
> > Prefixing my URLs so that they are relative to the
> > current page seems a
> > little hardcoded to me.
> >
> > Isn't the request for the image processed by the
> > sitemap?
> >
> > Thanks,
> >
> > Chris
> >
> > > -----Original Message-----
> > > From: Tibi DONDERA
> > [mailto:tibidondera@hotmail.com]
> > > Sent: 22 August 2001 15:31
> > > To: cocoon-users@xml.apache.org
> > > Subject: Re: can't match images in sitemap
> > >
> > >
> > > IMHO,
> > >
> > > Your configuration seems right. I bet that using
> > >
> > > <cocoon address>/images/my_image.jpg
> > > will give you the image.
> > >
> > > But the tag that is in your page should be <img
> > > src="../images/my_image.jpg">
> > > After all, the URL of the page is
> > >
> > > <cocoon address>/pages/my_page.html,
> > >
> > > right?
> > >
> > > Hope this helps.
> > >
> > >
> > > ----- Original Message -----
> > > From: "Chris Newland" <ch...@emorphia.com>
> > > To: "Cocoon-Users" <co...@xml.apache.org>
> > > Sent: Wednesday, August 22, 2001 4:10 PM
> > > Subject: C2: can't match images in sitemap
> > >
> > >
> > > > Hi All,
> > > >
> > > > I'm trying to add a map:match to my sitemap to
> > fetch images but they are
> > > not
> > > > fetched (my fault, Cocoon2 is working great)
> > > >
> > > > Location of my files:
> > > >
> > > >
> > tomcat/webapps/cocoon/docs/samples/pages/my_page.xsp
> > > >
> >
> tomcat/webapps/cocoon/docs/samples/images/my_image.jpg
> > > > tomcat/webapps/cocoon/stylesheets/my_xsl.xsl
> > > >
> > > > sitemap entries:
> > > >
> > > > <map:match pattern="pages/*">
> > > > <map:generate type="serverpages"
> > src="docs/samples/pages/{1}.xsp"/>
> > > > <map:transform src="stylesheets/my_xsl"/>
> > > > </map:match>
> > > >
> > > > (loads + processes XSP page fine)
> > > >
> > > > <map:match pattern="images/**.jpg">
> > > > <map:read src="docs/samples/images/{1}.jpg"
> > mime-type="image/jpg"/>
> > > > </map:match>
> > > >
> > > > (does not return the image)
> > > >
> > > > The returned HTML contains:
> > > >
> > > > <img src="images/my_image.jpg">
> > > >
> > > > As far as I can see, this is the same way that
> > the cocoon.gif image is
> > > > fetched from samples.xml but I can't see what
> > I'm doing wrong.
> > > >
> > > > Any help would be appreciated.
> > > >
> > > > Thanks,
> > > >
> > > > Chris
> > > >
> > > > --
> > > > Chris Newland
> > > > Software Research Engineer
> > > >
> > > > Emorphia Ltd
> > > > Registered in England.  4133002
> > > > Mill House, Station Approach, Harlow Mill,
> > Harlow, Essex, CM20 2EL, UK
> > > >
> > > > Email: chris.newland@emorphia.com
> > > > Tel: +44 (0)1279 450100
> > > > Fax: +44 (0)1279 450102
> > > >
> > > > Check out FIPA-OS at
> > http://fipa-os.sourceforge.net/
> > > >
> > > > This message may contain information proprietary
> > to Emorphia so any
> > > > unauthorised disclosure, copying or distribution
> > of its contents is
> > > strictly
> > > > prohibited.
> > > >
> > > >
> > > >
> > > >
> >
> ---------------------------------------------------------------------
> > > > 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>
> > > >
> > > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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>
> > >
> > >
> > >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > 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>
> >
>
> =====
> Thanks and have great day
> srini
>
> ____________________________________________________________
> Do You Yahoo!?
> For regular News updates go to http://in.news.yahoo.com
>
> ---------------------------------------------------------------------
> 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>
>
>
>



---------------------------------------------------------------------
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: can't match images in sitemap

Posted by java guru <ja...@yahoo.co.in>.
Yes.,
  there is abstraction between the url and actual
location of the files on the disk...But from my
understanding what the situation is..

1. If you have sent over html to browser with image
link as "/images/image1.jpg" and that html url is
"http://localhost:8080/cocoon/welcome"..

2. When the browser sends request back to server, the
request for image is formed like
"http://localhost:8080/images/image1.jpg"..this is
something browser did..

3. When the request hits the server, thr url doesnt
fall under category of url to be forwarded to
cocoon..and hence the web server(tomcat) try to handle
by itself(or root web application)..which would not
find the file obviously..

4. Now on the page of
"http://localhost:8080/cocoon/welcome/intro" if u have
image with "images/image1.gif" the request from
browser for image is formed like
"http://localhost:8080/cocoon/welcome/images/image1.jpg"..

5. Now once this request hits the server, the request
if forwarded to cocoon by the container, by this time
the uri becomes "welcom/images/image1.jpg" as it
entered to "cocoon" context..

6. This resulted uri is passed thru the "mathers" and
if u have match saying "
pattern="images/*.jpg"..obviously the requested uri
doesnt match with the specified pattern..

7. This has nothing to do with abstraction between uri
and actual file..This has to do with the way url are
handled by browser

 --- Chris Newland <ch...@emorphia.com> wrote:
> Thanks everyone,
> 
> Accessing the images directly works fine and so does
> prefixing the url with
> ../ (path back to webapp root) but my understanding
> was that the sitemap
> provided a total abstraction between the url fetched
> by the browser
> "images/my_image.jpg" and the actual file on disk.
> 
> Prefixing my URLs so that they are relative to the
> current page seems a
> little hardcoded to me.
> 
> Isn't the request for the image processed by the
> sitemap?
> 
> Thanks,
> 
> Chris
> 
> > -----Original Message-----
> > From: Tibi DONDERA
> [mailto:tibidondera@hotmail.com]
> > Sent: 22 August 2001 15:31
> > To: cocoon-users@xml.apache.org
> > Subject: Re: can't match images in sitemap
> >
> >
> > IMHO,
> >
> > Your configuration seems right. I bet that using
> >
> > <cocoon address>/images/my_image.jpg
> > will give you the image.
> >
> > But the tag that is in your page should be <img
> > src="../images/my_image.jpg">
> > After all, the URL of the page is
> >
> > <cocoon address>/pages/my_page.html,
> >
> > right?
> >
> > Hope this helps.
> >
> >
> > ----- Original Message -----
> > From: "Chris Newland" <ch...@emorphia.com>
> > To: "Cocoon-Users" <co...@xml.apache.org>
> > Sent: Wednesday, August 22, 2001 4:10 PM
> > Subject: C2: can't match images in sitemap
> >
> >
> > > Hi All,
> > >
> > > I'm trying to add a map:match to my sitemap to
> fetch images but they are
> > not
> > > fetched (my fault, Cocoon2 is working great)
> > >
> > > Location of my files:
> > >
> > >
> tomcat/webapps/cocoon/docs/samples/pages/my_page.xsp
> > >
>
tomcat/webapps/cocoon/docs/samples/images/my_image.jpg
> > > tomcat/webapps/cocoon/stylesheets/my_xsl.xsl
> > >
> > > sitemap entries:
> > >
> > > <map:match pattern="pages/*">
> > > <map:generate type="serverpages"
> src="docs/samples/pages/{1}.xsp"/>
> > > <map:transform src="stylesheets/my_xsl"/>
> > > </map:match>
> > >
> > > (loads + processes XSP page fine)
> > >
> > > <map:match pattern="images/**.jpg">
> > > <map:read src="docs/samples/images/{1}.jpg"
> mime-type="image/jpg"/>
> > > </map:match>
> > >
> > > (does not return the image)
> > >
> > > The returned HTML contains:
> > >
> > > <img src="images/my_image.jpg">
> > >
> > > As far as I can see, this is the same way that
> the cocoon.gif image is
> > > fetched from samples.xml but I can't see what
> I'm doing wrong.
> > >
> > > Any help would be appreciated.
> > >
> > > Thanks,
> > >
> > > Chris
> > >
> > > --
> > > Chris Newland
> > > Software Research Engineer
> > >
> > > Emorphia Ltd
> > > Registered in England.  4133002
> > > Mill House, Station Approach, Harlow Mill,
> Harlow, Essex, CM20 2EL, UK
> > >
> > > Email: chris.newland@emorphia.com
> > > Tel: +44 (0)1279 450100
> > > Fax: +44 (0)1279 450102
> > >
> > > Check out FIPA-OS at
> http://fipa-os.sourceforge.net/
> > >
> > > This message may contain information proprietary
> to Emorphia so any
> > > unauthorised disclosure, copying or distribution
> of its contents is
> > strictly
> > > prohibited.
> > >
> > >
> > >
> > >
>
---------------------------------------------------------------------
> > > 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>
> > >
> > >
> >
> >
>
---------------------------------------------------------------------
> > 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>
> >
> >
> >
> 
> 
> 
>
---------------------------------------------------------------------
> 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>
>  

=====
Thanks and have great day
srini

____________________________________________________________
Do You Yahoo!?
For regular News updates go to http://in.news.yahoo.com

---------------------------------------------------------------------
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: can't match images in sitemap

Posted by Vadim Gritsenko <vg...@hns.com>.
> -----Original Message-----
> From: Chris Newland [mailto:chris.newland@emorphia.com]
> Sent: Wednesday, August 22, 2001 11:00 AM
> To: cocoon-users@xml.apache.org
> Subject: RE: can't match images in sitemap
> 
> 
> Thanks everyone,
> 
> Accessing the images directly works fine and so does prefixing the url with
> ../ (path back to webapp root) but my understanding was that the sitemap
> provided a total abstraction between the url fetched by the browser
> "images/my_image.jpg" and the actual file on disk.
> 
> Prefixing my URLs so that they are relative to the current page seems a
> little hardcoded to me.
> 
> Isn't the request for the image processed by the sitemap?

Yes, but you need to correctly link it in HTML. Cocoon does NOT rewrites URL for you,
it is still your job to put correct absolute (to the root, not application) or relative URLs into
HTML.

Vadim

> 
> Thanks,
> 
> Chris
> 
> > -----Original Message-----
> > From: Tibi DONDERA [mailto:tibidondera@hotmail.com]
> > Sent: 22 August 2001 15:31
> > To: cocoon-users@xml.apache.org
> > Subject: Re: can't match images in sitemap
> >
> >
> > IMHO,
> >
> > Your configuration seems right. I bet that using
> >
> > <cocoon address>/images/my_image.jpg
> > will give you the image.
> >
> > But the tag that is in your page should be <img
> > src="../images/my_image.jpg">
> > After all, the URL of the page is
> >
> > <cocoon address>/pages/my_page.html,
> >
> > right?
> >
> > Hope this helps.
> >
> >
> > ----- Original Message -----
> > From: "Chris Newland" <ch...@emorphia.com>
> > To: "Cocoon-Users" <co...@xml.apache.org>
> > Sent: Wednesday, August 22, 2001 4:10 PM
> > Subject: C2: can't match images in sitemap
> >
> >
> > > Hi All,
> > >
> > > I'm trying to add a map:match to my sitemap to fetch images but they are
> > not
> > > fetched (my fault, Cocoon2 is working great)
> > >
> > > Location of my files:
> > >
> > > tomcat/webapps/cocoon/docs/samples/pages/my_page.xsp
> > > tomcat/webapps/cocoon/docs/samples/images/my_image.jpg
> > > tomcat/webapps/cocoon/stylesheets/my_xsl.xsl
> > >
> > > sitemap entries:
> > >
> > > <map:match pattern="pages/*">
> > > <map:generate type="serverpages" src="docs/samples/pages/{1}.xsp"/>
> > > <map:transform src="stylesheets/my_xsl"/>
> > > </map:match>
> > >
> > > (loads + processes XSP page fine)
> > >
> > > <map:match pattern="images/**.jpg">
> > > <map:read src="docs/samples/images/{1}.jpg" mime-type="image/jpg"/>
> > > </map:match>
> > >
> > > (does not return the image)
> > >
> > > The returned HTML contains:
> > >
> > > <img src="images/my_image.jpg">
> > >
> > > As far as I can see, this is the same way that the cocoon.gif image is
> > > fetched from samples.xml but I can't see what I'm doing wrong.
> > >
> > > Any help would be appreciated.
> > >
> > > Thanks,
> > >
> > > Chris
> > >
> > > --
> > > Chris Newland
> > > Software Research Engineer
> > >
> > > Emorphia Ltd
> > > Registered in England.  4133002
> > > Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK
> > >
> > > Email: chris.newland@emorphia.com
> > > Tel: +44 (0)1279 450100
> > > Fax: +44 (0)1279 450102
> > >
> > > Check out FIPA-OS at http://fipa-os.sourceforge.net/
> > >
> > > This message may contain information proprietary to Emorphia so any
> > > unauthorised disclosure, copying or distribution of its contents is
> > strictly
> > > prohibited.
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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>
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > 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>
> >
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> 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>
> 
> 

---------------------------------------------------------------------
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: can't match images in sitemap

Posted by Chris Newland <ch...@emorphia.com>.
Thanks everyone,

Accessing the images directly works fine and so does prefixing the url with
../ (path back to webapp root) but my understanding was that the sitemap
provided a total abstraction between the url fetched by the browser
"images/my_image.jpg" and the actual file on disk.

Prefixing my URLs so that they are relative to the current page seems a
little hardcoded to me.

Isn't the request for the image processed by the sitemap?

Thanks,

Chris

> -----Original Message-----
> From: Tibi DONDERA [mailto:tibidondera@hotmail.com]
> Sent: 22 August 2001 15:31
> To: cocoon-users@xml.apache.org
> Subject: Re: can't match images in sitemap
>
>
> IMHO,
>
> Your configuration seems right. I bet that using
>
> <cocoon address>/images/my_image.jpg
> will give you the image.
>
> But the tag that is in your page should be <img
> src="../images/my_image.jpg">
> After all, the URL of the page is
>
> <cocoon address>/pages/my_page.html,
>
> right?
>
> Hope this helps.
>
>
> ----- Original Message -----
> From: "Chris Newland" <ch...@emorphia.com>
> To: "Cocoon-Users" <co...@xml.apache.org>
> Sent: Wednesday, August 22, 2001 4:10 PM
> Subject: C2: can't match images in sitemap
>
>
> > Hi All,
> >
> > I'm trying to add a map:match to my sitemap to fetch images but they are
> not
> > fetched (my fault, Cocoon2 is working great)
> >
> > Location of my files:
> >
> > tomcat/webapps/cocoon/docs/samples/pages/my_page.xsp
> > tomcat/webapps/cocoon/docs/samples/images/my_image.jpg
> > tomcat/webapps/cocoon/stylesheets/my_xsl.xsl
> >
> > sitemap entries:
> >
> > <map:match pattern="pages/*">
> > <map:generate type="serverpages" src="docs/samples/pages/{1}.xsp"/>
> > <map:transform src="stylesheets/my_xsl"/>
> > </map:match>
> >
> > (loads + processes XSP page fine)
> >
> > <map:match pattern="images/**.jpg">
> > <map:read src="docs/samples/images/{1}.jpg" mime-type="image/jpg"/>
> > </map:match>
> >
> > (does not return the image)
> >
> > The returned HTML contains:
> >
> > <img src="images/my_image.jpg">
> >
> > As far as I can see, this is the same way that the cocoon.gif image is
> > fetched from samples.xml but I can't see what I'm doing wrong.
> >
> > Any help would be appreciated.
> >
> > Thanks,
> >
> > Chris
> >
> > --
> > Chris Newland
> > Software Research Engineer
> >
> > Emorphia Ltd
> > Registered in England.  4133002
> > Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK
> >
> > Email: chris.newland@emorphia.com
> > Tel: +44 (0)1279 450100
> > Fax: +44 (0)1279 450102
> >
> > Check out FIPA-OS at http://fipa-os.sourceforge.net/
> >
> > This message may contain information proprietary to Emorphia so any
> > unauthorised disclosure, copying or distribution of its contents is
> strictly
> > prohibited.
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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>
> >
> >
>
> ---------------------------------------------------------------------
> 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>
>
>
>



---------------------------------------------------------------------
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>