Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 82681 invoked from network); 10 Jan 2007 12:21:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jan 2007 12:21:36 -0000 Received: (qmail 27993 invoked by uid 500); 10 Jan 2007 12:21:32 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 27964 invoked by uid 500); 10 Jan 2007 12:21:32 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 27953 invoked by uid 99); 10 Jan 2007 12:21:32 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jan 2007 04:21:32 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [202.157.148.20] (HELO mail20.bluerapport.com) (202.157.148.20) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jan 2007 04:21:21 -0800 Received: from mail.bluesingapore.com (unknown [202.157.148.8]) by mail20.bluerapport.com (Postfix) with ESMTP id C13B3A38D5F for ; Wed, 10 Jan 2007 20:28:16 +0800 (SGT) Received: from ([127.0.0.1]) with MailEnable ESMTP; Wed, 10 Jan 2007 20:31:39 +0800 From: "Chetan Pandey" To: "'Struts Users Mailing List'" Subject: RE: Browser Back Button Date: Wed, 10 Jan 2007 20:17:59 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: <45A3C22E.8070005@christopherschultz.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Thread-Index: Acc0DDBsXTDOBEm1RuGMBPMq9DqM0gAo+4gg Message-Id: <20070110122816.C13B3A38D5F@mail20.bluerapport.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi Chris: > What browser are you using? Is your setup action being executed again, > or is the browser serving the page from the cache? If the browser is not > contacting the server, there's nothing you can do. I am using IE 7.0. Regarding contacting the server, something very weird is happening. If my execute method has the following line: request.getSession().setAttribute("eventForm", new EventForm() ); It will contact the Server - as all debug statements are printed. However, if I remove this one line, then it doesn't contact the server and fetches everything from cache - since no debug statement is printed. I have checked other places also. Clicking back button doesn't go to the server. Since no debug statement is printed. Only the presence of the above line makes a weird difference. Chetan Pandey wrote: > To avoid this problem I introduced the following > request.getSession().setAttribute("eventForm", new EventForm()). >If you are using Struts form beans, it might be better to blank the >existing bean instead of creating a new one. Something like this: >EventForm ef = (EventForm)form; >ef.setFoo(null); >ef.setBar(null); >// etc. It didn't help. Still went to the Server. > I go to the form page and then click add. It goes to the Preview page. > Everything shows perfectly. Now I click on the Back Button. Lo and Behold > !!!!! The Add Fields are all empty. >What browser are you using? Is your setup action being executed again, >or is the browser serving the page from the cache? If the browser is not >contacting the server, there's nothing you can do. > (Actually, that's not true... if you are using javascript to do some >funny things with the form, submission, etc., then you are likely >causing your own problems. If, however, your form is standard then the >browser /should/ be keeping the form data there if you do a SUBMIT >followed by a BACK). >If the browser /is/ contacting the server, then you need to look at what >is happening in your action. For instance, if the above code is running, >then /of course/ you are ending up with a blank bean. >One way around this would be to put an action /in front/ of the editing >action that blanks any existing form bean and then redirects (not >forwards) to the editing action (which does /not/ blank the bean). In >this case, you'll get a fresh bean for editing, but pressing BACK will >result in the user returning to the "edit" action instead of the >"blank-and-then-edit" action. Of course, if the user presses BACK twice, >then you'll get a blank bean again. ;) >Hope that helps, >- -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFo8Iu9CaO5/Lv0PARAtAHAJ9RkZfhNyjOdMttiFmuaO9m7TW74ACeLKxB jStpytMzn+2l6dPLELV//lo= =qP9A -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org Thanks. Chetan --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org