Return-Path: Delivered-To: apmail-incubator-wicket-commits-archive@locus.apache.org Received: (qmail 82542 invoked from network); 26 Jun 2007 14:53:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Jun 2007 14:53:47 -0000 Received: (qmail 8818 invoked by uid 500); 26 Jun 2007 14:53:50 -0000 Delivered-To: apmail-incubator-wicket-commits-archive@incubator.apache.org Received: (qmail 8809 invoked by uid 500); 26 Jun 2007 14:53:50 -0000 Mailing-List: contact wicket-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: wicket-dev@incubator.apache.org Delivered-To: mailing list wicket-commits@incubator.apache.org Received: (qmail 8800 invoked by uid 99); 26 Jun 2007 14:53:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2007 07:53:50 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2007 07:53:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0317D71419B for ; Tue, 26 Jun 2007 07:53:26 -0700 (PDT) Message-ID: <17679892.1182869606010.JavaMail.jira@brutus> Date: Tue, 26 Jun 2007 07:53:26 -0700 (PDT) From: =?utf-8?Q?J=C3=A1nos_Cser=C3=A9p_=28JIRA=29?= To: wicket-commits@incubator.apache.org Subject: [jira] Issue Comment Edited: (WICKET-631) Resource.getParameters() empty when resource is mounted In-Reply-To: <11944465.1181408425979.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/WICKET-631?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508188 ]=20 J=C3=A1nos Cser=C3=A9p edited comment on WICKET-631 at 6/26/07 7:51 AM: -------------------------------------------------------------- I think I've found the line that causes this problem. In Resource.java: finally =09=09{ =09=09=09// Really really really make sure parameters are cleared =09=09=09parameters.set(null); =09=09} is called in the end of onResourceRequested(). This is called in the PROCES= S_EVENTS step. The code before this is: cycle.setRequestTarget(new ResourceStreamRequestTarget(resourceStream)); Which sets a new RequestTarget but doesn't yet call my custom DynamicWebRes= ource's getResourceState method (where I'm calling getParameters()) When the lifecycle of the request continues we enter into the RESPOND step = which eventually calls my subclassed DynamicWebResource and it's getResourc= eStream method. At this time the Resource's threadlocal for parameters is a= lready null. If the page is not mounted then Resource.getParameters() can still access t= he parameters through RequestCycle.get().getRequest().getParameters(), but = when the resource is mounted, this fails. Can someone check out why you really really really have to make sure that t= he parameters are cleared in the PROCESS_EVENTS step? I guess you didn't wa= nt to have objects lying around in the ThreadLocal, but that should really = be moved after the resource finished assembling the response to the request= . Is calling Resource.getParameters() illegal from the getResourceState metho= d of DynamicWebResource?=20 The hack in Resource.getParameters which falls back to the RequestCycle is = also quite ugly and I think should be reconsidered (I haven't found the cod= e snippet which clears that when the request is finished) Thanks, janos was: I think I've found the line that causes this problem. In Resource.java: finally =09=09{ =09=09=09// Really really really make sure parameters are cleared =09=09=09parameters.set(null); =09=09} is called in onResourceRequested(). This is called in the PROCESS_EVENTS st= ep. So in the RESPOND step my application doesn't see the parameters anymore. If the page is not mounted then Resource.getParameters() can still access t= he parameters through RequestCycle.get().getRequest().getParameters(), but = when the resource is mounted, this fails. Can someone check out why you really really really have to make sure that t= he parameters are cleared in the PROCESS_EVENTS step? I guess you didn't wa= nt to have objects lying around in the ThreadLocal, but that should really = be moved after the resource finished assembling the response to the request= . Thanks, janos > Resource.getParameters() empty when resource is mounted > ------------------------------------------------------- > > Key: WICKET-631 > URL: https://issues.apache.org/jira/browse/WICKET-631 > Project: Wicket > Issue Type: Bug > Components: wicket > Affects Versions: 1.3.0-beta1 > Environment: wicket 1.3.0-incubating-SNAPSHOT running on Glassfis= h and JDK 1.6.0 > Reporter: J=C3=A1nos Cser=C3=A9p > Fix For: 1.3.0-beta3 > > > After migrating my application from 1.2.6 to 1.3.0-incubating-SNAPSHOT mo= unted shared resources (rss feeds, uploaded images) stopped working. > DynamicWebResource.getParameters().getXXX() returns with null if the reso= urce is mounted via Application.mountSharedResource but it works fine when = the resource is not mounted. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.