Return-Path: X-Original-To: apmail-cocoon-dev-archive@www.apache.org Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0ADA09808 for ; Mon, 12 Dec 2011 09:25:03 +0000 (UTC) Received: (qmail 42541 invoked by uid 500); 12 Dec 2011 09:25:02 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 42475 invoked by uid 500); 12 Dec 2011 09:25:02 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 42468 invoked by uid 99); 12 Dec 2011 09:25:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2011 09:25:02 +0000 X-ASF-Spam-Status: No, hits=-2001.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2011 09:24:53 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 60055CB354 for ; Mon, 12 Dec 2011 09:24:31 +0000 (UTC) Date: Mon, 12 Dec 2011 09:24:31 +0000 (UTC) From: =?utf-8?Q?C=C3=A9dric_Damioli_=28Updated=29_=28JIRA=29?= To: dev@cocoon.apache.org Message-ID: <1711098371.839.1323681871395.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <265120230.830.1323681631133.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (COCOON-2319) Bad Environment context when redirecting to cocoon:// with a sitemap not located in the webapp context MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COCOON-2319?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] C=C3=A9dric Damioli updated COCOON-2319: ----------------------------------- Attachment: ConcreteTreeProcessor.java.patch =20 > Bad Environment context when redirecting to cocoon:// with a sitemap not = located in the webapp context > -------------------------------------------------------------------------= ----------------------------- > > Key: COCOON-2319 > URL: https://issues.apache.org/jira/browse/COCOON-2319 > Project: Cocoon > Issue Type: Bug > Components: * Cocoon Core > Affects Versions: 2.1.11 > Reporter: C=C3=A9dric Damioli > Fix For: 2.1.12-dev (Current SVN) > > Attachments: ConcreteTreeProcessor.java.patch > > > Let say I have a root sitemap not located in the webapp context, with a s= imple pipeline like : > {code:xml} > > > > {code} > If I call directly, the URI /foo, I correctly get the image foo.png > Now, if I have a second sitemap elsewhere, mounted from the first one, wi= th another simple pipeline like : > {code:xml} > > > > {code} > If I call /foo/bar, I get a 404 Not Found saying that it looks for foo.pn= g in the webapp context, and not relative to the root sitemap. > Looking at the code, I discovered that in the first case, in the method T= reeProcessor.setupConcreteProcessor(), we have a statement especially for h= andling the case of sitemap not located in the webapp context : > {code:java} > if (this.parent =3D=3D null) { > // Ensure root sitemap uses the correct context, even if not = located in the webapp context > env.changeContext("", this.source.getURI()); > } > {code} > while in the second case, where the ConcreteTreeProcessor is managed in t= he method ConcreteTreeProcessor.handleCocoonRedirect(), there's no such sta= tement. > I'll provide a patch for fixing this, but looking deeper at the code, I f= ound that this looked like a hack (even for the existing statement). > I think it would be better to have the right root context at the creation= of the environment, and not to have to change it later when building the C= oncreteTreeProcessor. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira