You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nick Entin <en...@togethersoft.com> on 2001/11/05 16:39:50 UTC
Redirect-to
Hello,
Does anyone know how to specify correct uri for redirect-to?
Or by other words, how to specify absolute URI?
For example, I have the following structure:
<host:port>/cocoon/prj (and local xmap is defined there)
dir1/a.java
dir1/dir2/b.java
JavaDoc/index.html
JavaDoc/dir1/a.html
JavaDoc/dir1/dir2/b.html
I'd like to write something like that:
<map:match pattern="**.java">
<map:redirect-to uri="JavaDoc/index.html"/>
</map:match>
Unfortunately that does not work because the uri is concatenated with
current context (like if my current context was dir2 then result url
will be "<host:port>/cocoon/prj/dir1/dir2/JavaDoc/index.html" (the
information I read in log)
Adding slashes in front of the uri brings me "404 file not found" result
and no records in logs (so I don't even know how the paths are
interpreted).
>From sources and changes.html I learned that
- URI may contain some macros ({...} I presume, may be something else?)
- context: is not supported protocol for URI yet(though I'm not sure it
could help me).
Any ideas?
Any help is appreciated!
Thanks!
Nick
---------------------------------------------------------------------
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: Redirect-to
Posted by Heath Stewart <hs...@esotericrealm.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
That's a relative URI. Absolute URI's always start from the root of the
server ("/") and don't necessarily have to contain the scheme:server:port to
be absolute.
One thing to keep in mind as well, Nick, is that Tomcat basically chroot's
(a *nix) term meaning makes it the root for a process / thread) a webapp's
context so that absolute URI's as references by your servlet, etc. could
actually start from http://localhost:8080/MyServlet instead of
http://localhost:8080/.
Heath Stewart
Network Administrator / Web Developer
College of Veterinary Medicine
Iowa State University
http://www.vetmed.iastate.edu
- ----- Original Message -----
From: "David Rosenstrauch" <da...@dti.net>
To: <co...@xml.apache.org>
Sent: Monday, November 05, 2001 10:56 AM
Subject: Re: Redirect-to
> How about:
>
> > <map:redirect-to uri="../../JavaDoc/index.html"/>
>
>
>
> DR
>
>
>
>
> At 04:39 PM 11/5/01 +0100, you wrote:
> >Hello,
> >
> >Does anyone know how to specify correct uri for redirect-to?
> >Or by other words, how to specify absolute URI?
> >
> >For example, I have the following structure:
> ><host:port>/cocoon/prj (and local xmap is defined there)
> > dir1/a.java
> > dir1/dir2/b.java
> > JavaDoc/index.html
> > JavaDoc/dir1/a.html
> > JavaDoc/dir1/dir2/b.html
> >
> >I'd like to write something like that:
> >
> > <map:match pattern="**.java">
> > <map:redirect-to uri="JavaDoc/index.html"/>
> > </map:match>
> >
> >Unfortunately that does not work because the uri is concatenated with
> >current context (like if my current context was dir2 then result url
> >will be "<host:port>/cocoon/prj/dir1/dir2/JavaDoc/index.html" (the
> >information I read in log)
> >
> >Adding slashes in front of the uri brings me "404 file not found" result
> >and no records in logs (so I don't even know how the paths are
> >interpreted).
> >
> > >From sources and changes.html I learned that
> >- URI may contain some macros ({...} I presume, may be something else?)
> >- context: is not supported protocol for URI yet(though I'm not sure it
> >could help me).
> >
> >Any ideas?
> >
> >Any help is appreciated!
> >
> >Thanks!
> >Nick
> >
> >
> >
> >---------------------------------------------------------------------
> >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>
>
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
Comment: http://www.esotericrealm.com/~hstewart/pgp/
iQA/AwUBO+bM84H94e77dEeYEQI65ACgs49ss6I+b40dXJDsuSJyrFiu9OEAoJ4R
31ylqHsumRdUn5vrn8oefgET
=WVhv
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
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: Redirect-to
Posted by David Rosenstrauch <da...@dti.net>.
How about:
> <map:redirect-to uri="../../JavaDoc/index.html"/>
DR
At 04:39 PM 11/5/01 +0100, you wrote:
>Hello,
>
>Does anyone know how to specify correct uri for redirect-to?
>Or by other words, how to specify absolute URI?
>
>For example, I have the following structure:
><host:port>/cocoon/prj (and local xmap is defined there)
> dir1/a.java
> dir1/dir2/b.java
> JavaDoc/index.html
> JavaDoc/dir1/a.html
> JavaDoc/dir1/dir2/b.html
>
>I'd like to write something like that:
>
> <map:match pattern="**.java">
> <map:redirect-to uri="JavaDoc/index.html"/>
> </map:match>
>
>Unfortunately that does not work because the uri is concatenated with
>current context (like if my current context was dir2 then result url
>will be "<host:port>/cocoon/prj/dir1/dir2/JavaDoc/index.html" (the
>information I read in log)
>
>Adding slashes in front of the uri brings me "404 file not found" result
>and no records in logs (so I don't even know how the paths are
>interpreted).
>
> >From sources and changes.html I learned that
>- URI may contain some macros ({...} I presume, may be something else?)
>- context: is not supported protocol for URI yet(though I'm not sure it
>could help me).
>
>Any ideas?
>
>Any help is appreciated!
>
>Thanks!
>Nick
>
>
>
>---------------------------------------------------------------------
>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: Redirect-to
Posted by Nick Entin <en...@togethersoft.com>.
I did not try that and would prefer not to use this way: particularly I
(XMAP) don't know on which host:port Tomcat is running...
Thanks you!
> -----Original Message-----
> From: Alex Vishnev [mailto:avishnev@optonline.net]
> Sent: Monday, November 05, 2001 5:37 PM
> To: cocoon-users@xml.apache.org
> Subject: RE: Redirect-to
>
>
> This might sound stupid, but have you tried
> <map:match pattern="**.java">
> <map:redirect-to uri="http://<host:port>/JavaDoc/index.html"/>
> </map:match>
>
> Absolute URI should always begin with protocol prefix (http,
> ftp, etc) and host/port identifier. I have not tried that
> myself yet ... ;)
>
> Alex
> -----Original Message-----
> From: Nick Entin [mailto:entin@togethersoft.com]
> Sent: Monday, November 05, 2001 10:40 AM
> To: cocoon-users@xml.apache.org
> Subject: Redirect-to
>
> Hello,
>
> Does anyone know how to specify correct uri for redirect-to?
> Or by other words, how to specify absolute URI?
>
> For example, I have the following structure:
> <host:port>/cocoon/prj (and local xmap is defined there)
> dir1/a.java
> dir1/dir2/b.java
> JavaDoc/index.html
> JavaDoc/dir1/a.html
> JavaDoc/dir1/dir2/b.html
>
> I'd like to write something like that:
>
> <map:match pattern="**.java">
> <map:redirect-to uri="JavaDoc/index.html"/>
> </map:match>
>
> Unfortunately that does not work because the uri is
> concatenated with current context (like if my current context
> was dir2 then result url will be
> "<host:port>/cocoon/prj/dir1/dir2/JavaDoc/index.html" (the
> information I read in log)
>
> Adding slashes in front of the uri brings me "404 file not
> found" result and no records in logs (so I don't even know
> how the paths are interpreted).
>
> >From sources and changes.html I learned that
> - URI may contain some macros ({...} I presume, may be
> something else?)
> - context: is not supported protocol for URI yet(though I'm
> not sure it could help me).
>
> Any ideas?
>
> Any help is appreciated!
>
> Thanks!
> Nick
>
>
>
> ---------------------------------------------------------------------
> 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: Redirect-to
Posted by Alex Vishnev <av...@optonline.net>.
This might sound stupid, but have you tried
<map:match pattern="**.java">
<map:redirect-to uri="http://<host:port>/JavaDoc/index.html"/>
</map:match>
Absolute URI should always begin with protocol prefix (http, ftp, etc) and
host/port identifier. I have not tried that myself yet ... ;)
Alex
-----Original Message-----
From: Nick Entin [mailto:entin@togethersoft.com]
Sent: Monday, November 05, 2001 10:40 AM
To: cocoon-users@xml.apache.org
Subject: Redirect-to
Hello,
Does anyone know how to specify correct uri for redirect-to?
Or by other words, how to specify absolute URI?
For example, I have the following structure:
<host:port>/cocoon/prj (and local xmap is defined there)
dir1/a.java
dir1/dir2/b.java
JavaDoc/index.html
JavaDoc/dir1/a.html
JavaDoc/dir1/dir2/b.html
I'd like to write something like that:
<map:match pattern="**.java">
<map:redirect-to uri="JavaDoc/index.html"/>
</map:match>
Unfortunately that does not work because the uri is concatenated with
current context (like if my current context was dir2 then result url
will be "<host:port>/cocoon/prj/dir1/dir2/JavaDoc/index.html" (the
information I read in log)
Adding slashes in front of the uri brings me "404 file not found" result
and no records in logs (so I don't even know how the paths are
interpreted).
>From sources and changes.html I learned that
- URI may contain some macros ({...} I presume, may be something else?)
- context: is not supported protocol for URI yet(though I'm not sure it
could help me).
Any ideas?
Any help is appreciated!
Thanks!
Nick
---------------------------------------------------------------------
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>