Return-Path: Delivered-To: apmail-wicket-users-archive@locus.apache.org Received: (qmail 33305 invoked from network); 1 Feb 2008 19:41:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Feb 2008 19:41:32 -0000 Received: (qmail 42562 invoked by uid 500); 1 Feb 2008 19:41:20 -0000 Delivered-To: apmail-wicket-users-archive@wicket.apache.org Received: (qmail 42544 invoked by uid 500); 1 Feb 2008 19:41:20 -0000 Mailing-List: contact users-help@wicket.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@wicket.apache.org Delivered-To: mailing list users@wicket.apache.org Received: (qmail 42533 invoked by uid 99); 1 Feb 2008 19:41:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2008 11:41:20 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2008 19:40:52 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1JL1kw-0007Hl-N8 for users@wicket.apache.org; Fri, 01 Feb 2008 11:40:58 -0800 Message-ID: <15231990.post@talk.nabble.com> Date: Fri, 1 Feb 2008 11:40:58 -0800 (PST) From: elliotk To: users@wicket.apache.org Subject: UploadInfo subject in session MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: elliot.khazon@gmail.com X-Virus-Checked: Checked by ClamAV on apache.org Requirement: The user can upload only one file at a time. The use case is this. A user wants to upload a file. They hit an upload button and upload progress bar appears. The user gets bored and decides to do something else while upload is going on. So they open another instance. They decide to upload another file (watching the previous upload). They try to upload another file, application doesn't let them and let's them know another upload is in progress. I tried to use UploadProgressBar for this purpose. At first I did exactly what the example showed, that is wrap all the requests into UploadWebRequest on application level and set the form to multiPart=true. That didn't work, and my progress bar would not update. The only thing i didn't do was i didn't mount my pages. So the page that is doing the upload is not a bookmarkable page. Is it a requirement for it? Anyway, i decided to help the upload out a little bit and create my own instance of uploadinfo and put that in session when uploaded started and when upload finished. I also updated it during the file upload appropriately. It worked fine. Until I tried to launch another web page and try to upload. It broke the current upload because it was competing for the uploadinfo obj in session. I figured it was because uploadinfo was keyed on UploadWebRequest.class.getName() - therefore not unique key. So I tried to work around it by creating a unique key (UploadWebRequest.class.getName() + pagePapName()) or just a name of a different class (MyUniquePage.class.getName()). That didn't work. More over I tried creating a synchronized block of code that would only set/get uploadinfo session variable in them, therefore restricting access to the waiting threads. All without lock. I settled down (for now) with creating my own session object, that informs user is there is an upload in progress. As far as upload progress, i think i will create an ajax component that will pull the status of the upload. Let me know if i am completely offline. Thanks. -- View this message in context: http://www.nabble.com/UploadInfo-subject-in-session-tp15231990p15231990.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For additional commands, e-mail: users-help@wicket.apache.org