You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Homeijer <M....@devote.nl> on 2001/04/13 15:57:18 UTC
XMLFragmentBase
The Cocoon 1 website mentions an XMLFragmentBase class to simplify migration
from Cocoon 1 to Cocoon 2, when use is made of XMLFragments or XObject.
Has anyone allready built this class?
If not, what kind of code should I write to accomplish the same (see also
http://xml.apache.org/cocoon/xmlfragment.html on the bottom of the page)
TIA,
Michael
---------------------------------------------------------------------
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: [C2] Sitemap redirect bug or feature?
Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
> > > That's a question for your servlet container vendor. I can tell you
this:
> > > the official Servlet 2.3 spec states that the redirect to "/" goes to
the
> > > server root, not the context root.
> >
> > Is that so? It's interesting, in what case it may be useful...
>
> From what I understand, the debate was heated. However, I think the
> reasoning is that some companies want the freedom to separate their
> web enabled processes to separate contexts. In that environment,
> if redirect to "/" goes to the context root, then it is impossible
> to automatically send someone to a related process that is in a
> separate context.
Ok, thank you for the explanation.
> Personally, I can understand the arguments from both sides, and managing
> URI space is very difficult. In Cocoon 2, it becomes much easier, and
> we have implemented the concept of sub-sitemaps. You can place cocoon
> as your root context, and let it handle all the redirects.
>
> But unfortunately, not everyone is using Cocoon :(
Sub-sitemaps? Where I can learn more about it? I thought about similar
possibility before - to use Cocoon as default handler for all *.xsp
requests, but couldn't find any sample of such usage.
> > > It may be something where we might create a convenience to redirect
> > relative
> > > to a context. I will propose something like this in the Cocoon
> > development
> > > list.
> >
> > Thank you.
> >
> > I'd prefer to have three options: relative to the current request path,
> > relative to context and the third one for compatibility with the Servlet
> > specification - relative to the server root.
>
> The way the servlet spec works is the redirect() will let you do the
following:
>
> Current URI (cocoon context): http://localhost/cocoon/index.html
>
> Relative Path: "foo/bar" maps to "http://localhost/cocoon/foo/bar"
> Relative Path: "../index.html" maps to "http://localhost/index.html"
> Absolute Path: "/foo/bar" maps to "http://localhost/foo/bar"
> Absolute URI: "http://xml.apache.org/cocoon/cocoon2" maps to that URI
>
> I proposed an additional way for Cocoon to react and that is:
>
> Context Path: "context://foo/bar" maps to
"http://localhost/cocoon/foo/bar"
> Context Path: "context://index.html" maps to
"http://localhost/cocoon/index.html"
>
> Is there anything else that you would need?
I think, that it will be quite enough for me and many others who have a
single web application (and one context), so they will need only context
redirects.
Maybe it'll be better to add an attribute to map:redirect-to?
<map:redirect-to root="context" uri="relative-to/context" />
Regards,
Kot.
---------------------------------------------------------------------
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: [C2] Sitemap redirect bug or feature?
Posted by Berin Loritsch <bl...@apache.org>.
"Piroumian, Konstantin" wrote:
>
> > That's a question for your servlet container vendor. I can tell you this:
> > the official Servlet 2.3 spec states that the redirect to "/" goes to the
> > server root, not the context root.
>
> Is that so? It's interesting, in what case it may be useful...
>From what I understand, the debate was heated. However, I think the
reasoning is that some companies want the freedom to separate their
web enabled processes to separate contexts. In that environment,
if redirect to "/" goes to the context root, then it is impossible
to automatically send someone to a related process that is in a
separate context.
Personally, I can understand the arguments from both sides, and managing
URI space is very difficult. In Cocoon 2, it becomes much easier, and
we have implemented the concept of sub-sitemaps. You can place cocoon
as your root context, and let it handle all the redirects.
But unfortunately, not everyone is using Cocoon :(
> > It may be something where we might create a convenience to redirect
> relative
> > to a context. I will propose something like this in the Cocoon
> development
> > list.
>
> Thank you.
>
> I'd prefer to have three options: relative to the current request path,
> relative to context and the third one for compatibility with the Servlet
> specification - relative to the server root.
The way the servlet spec works is the redirect() will let you do the following:
Current URI (cocoon context): http://localhost/cocoon/index.html
Relative Path: "foo/bar" maps to "http://localhost/cocoon/foo/bar"
Relative Path: "../index.html" maps to "http://localhost/index.html"
Absolute Path: "/foo/bar" maps to "http://localhost/foo/bar"
Absolute URI: "http://xml.apache.org/cocoon/cocoon2" maps to that URI
I proposed an additional way for Cocoon to react and that is:
Context Path: "context://foo/bar" maps to "http://localhost/cocoon/foo/bar"
Context Path: "context://index.html" maps to "http://localhost/cocoon/index.html"
Is there anything else that you would need?
---------------------------------------------------------------------
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: [C2] Sitemap redirect bug or feature?
Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
> > I noticed, that when I use <map:redirect-to> then it works not as I was
> > expecting. E.g. when I use an uri with a leading slash (
/search/file.xml)
> > then the request is redirected to the host root and not to the context
root.
> > I mean:
> > context path - myapp (webapps/myapp)
> > sitemap entry:
> > <map:match pattern="search/client-search.xml">
> > <map:redirect-to uri="/clients/clientlist.xml" />
> > </map:match>
> >
> > request - http://localhost/myapp/search/client-search.xml
> > redirected to http://localhost/clients/clientlist.xml and not to the
> > http://localhost/myapp/clients/clientlist.xml
> >
> > As you can see, the context path of my application is ignored.
> > Is that a bug or it was designed so?
>
> That's a question for your servlet container vendor. I can tell you this:
> the official Servlet 2.3 spec states that the redirect to "/" goes to the
> server root, not the context root.
Is that so? It's interesting, in what case it may be useful...
> It may be something where we might create a convenience to redirect
relative
> to a context. I will propose something like this in the Cocoon
development
> list.
Thank you.
I'd prefer to have three options: relative to the current request path,
relative to context and the third one for compatibility with the Servlet
specification - relative to the server root.
---------------------------------------------------------------------
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: [C2] Sitemap redirect bug or feature?
Posted by Berin Loritsch <bl...@apache.org>.
"Piroumian, Konstantin" wrote:
>
> Hello!
>
> I noticed, that when I use <map:redirect-to> then it works not as I was
> expecting. E.g. when I use an uri with a leading slash ( /search/file.xml)
> then the request is redirected to the host root and not to the context root.
> I mean:
> context path - myapp (webapps/myapp)
> sitemap entry:
> <map:match pattern="search/client-search.xml">
> <map:redirect-to uri="/clients/clientlist.xml" />
> </map:match>
>
> request - http://localhost/myapp/search/client-search.xml
> redirected to http://localhost/clients/clientlist.xml and not to the
> http://localhost/myapp/clients/clientlist.xml
>
> As you can see, the context path of my application is ignored.
> Is that a bug or it was designed so?
That's a question for your servlet container vendor. I can tell you this:
the official Servlet 2.3 spec states that the redirect to "/" goes to the
server root, not the context root.
It may be something where we might create a convenience to redirect relative
to a context. I will propose something like this in the Cocoon development
list.
---------------------------------------------------------------------
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>
[C2] Sitemap redirect bug or feature?
Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
Hello!
I noticed, that when I use <map:redirect-to> then it works not as I was
expecting. E.g. when I use an uri with a leading slash ( /search/file.xml)
then the request is redirected to the host root and not to the context root.
I mean:
context path - myapp (webapps/myapp)
sitemap entry:
<map:match pattern="search/client-search.xml">
<map:redirect-to uri="/clients/clientlist.xml" />
</map:match>
request - http://localhost/myapp/search/client-search.xml
redirected to http://localhost/clients/clientlist.xml and not to the
http://localhost/myapp/clients/clientlist.xml
As you can see, the context path of my application is ignored.
Is that a bug or it was designed so?
Best regards,
Konstantin Piroumian
Software engineer
Protek Flagship LLC
Phone: + 7 095 795 0520 (add. 1288)
Fax: + 7 095 795 0525
E-mail: kpiroumian@flagship.ru
http://www.protek.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>