struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chiji nwankwo" <cn...@hotmail.com>
Subject Removing bean from session scope
Date Wed, 29 Aug 2001 09:12:12 GMT
<html><div style='background-color:'><DIV>
<P>Hi Andre,</P>
<P>I picked up on something you said in your message yesterday about removing a bean
from session scope.&nbsp; I have 2 pages in my application, the first page (archive.jsp)
consists of select boxes, which populate each other without having to click on a submit button
and the second page (results.jsp) which displays a list of the user's selection, when a link
has been clicked.&nbsp; </P>
<P>After the user has clicked on the link, which takes to them to the results page I
want to be able to reset the contents of the form so that if the user clicks on the back button,
the contents of the form would have been re-initialized.</P>
<P>Removing the bean from session scope I feel might be the answer to my problem.&nbsp;
</P>
<P>Thanks for your help.</P>
<P>Chiji</P></DIV>
<DIV></DIV>
<DIV></DIV>&gt;From: "Paradis, André" <ANDRE.PARADIS@VERSALYS.COM>
<DIV></DIV>&gt;Reply-To: struts-user@jakarta.apache.org 
<DIV></DIV>&gt;To: <STRUTS-USER@JAKARTA.APACHE.ORG>
<DIV></DIV>&gt;Subject: RE: Validation FW: Displaying messages passed the
request 
<DIV></DIV>&gt;Date: Tue, 28 Aug 2001 14:12:00 -0400 
<DIV></DIV>&gt;MIME-Version: 1.0 
<DIV></DIV>&gt;Received: from [64.125.133.20] by hotmail.com (3.2) with ESMTP
id MHotMailBD552B5A000640042A1A407D85140FDB0; Tue, 28 Aug 2001 11:18:02 -0700 
<DIV></DIV>&gt;Received: (qmail 31125 invoked by uid 500); 28 Aug 2001 18:10:05
-0000 
<DIV></DIV>&gt;Received: (qmail 31115 invoked from network); 28 Aug 2001 18:10:05
-0000 
<DIV></DIV>&gt;Received: from unknown (HELO srvexc1.versalys.com) (206.162.152.15)
by daedalus.apache.org with SMTP; 28 Aug 2001 18:10:05 -0000 
<DIV></DIV>&gt;From struts-user-return-16203-cn081 Tue, 28 Aug 2001 11:18:32
-0700 
<DIV></DIV>&gt;Mailing-List: contact struts-user-help@jakarta.apache.org;
run by ezmlm 
<DIV></DIV>&gt;Precedence: bulk 
<DIV></DIV>&gt;list-help: <?xml:namespace prefix = mailto /><mailto:struts-user-help@jakarta.apache.org>
<DIV></DIV>&gt;list-unsubscribe: <mailto:struts-user-unsubscribe@jakarta.apache.org>
<DIV></DIV>&gt;list-post: <mailto:struts-user@jakarta.apache.org>
<DIV></DIV>&gt;Delivered-To: mailing list struts-user@jakarta.apache.org 
<DIV></DIV>&gt;content-class: urn:content-classes:message 
<DIV></DIV>&gt;X-MimeOLE: Produced By Microsoft Exchange V6.0.4712.0 
<DIV></DIV>&gt;Message-ID: &lt;6A8E037FA5B2624982E2A38E89DA4D880B0CFB@srvexc1.versalys.com&gt;

<DIV></DIV>&gt;X-MS-Has-Attach: 
<DIV></DIV>&gt;X-MS-TNEF-Correlator: 
<DIV></DIV>&gt;Thread-Topic: Validation FW: Displaying messages passed the
request 
<DIV></DIV>&gt;Thread-Index: AcEv605KurbJYeuOSwuc1jYIkl+krwAANFUQ 
<DIV></DIV>&gt;X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Matt, 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Doing a redirection causes a new request to be created, thus
you loose 
<DIV></DIV>&gt;everything you put in the previous request object. You could
save your 
<DIV></DIV>&gt;messages in user session scope, then do your redirection. The
next page 
<DIV></DIV>&gt;will have access to the user session and you'll be able to
read those 
<DIV></DIV>&gt;messages. After messages are read, you can remove the bean
from session 
<DIV></DIV>&gt;scope in order preserve memory on the server. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Andre Paradis 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;-----Original Message----- 
<DIV></DIV>&gt;From: Matt Raible [mailto:matt_raible@yahoo.com] 
<DIV></DIV>&gt;Sent: Tuesday, August 28, 2001 2:01 PM 
<DIV></DIV>&gt;To: Struts User 
<DIV></DIV>&gt;Subject: Validation FW: Displaying messages passed the request

<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;I have a SaveAction that sets up some success messages using:

<DIV></DIV>&gt; 
<DIV></DIV>&gt;messages.add(new ActionMessage("timesheetManage.save.success"));

<DIV></DIV>&gt;saveMessages(Constants.MESSAGE_KEY, request, messages); 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;And upon this save, the findForward("success") forwards to
another 
<DIV></DIV>&gt;action class with: 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;<FORWARD DIV <>&gt; name="success" 
<DIV></DIV>&gt; path="/do/editTimesheet?action=Edit" redirect="true" /&gt;

<DIV></DIV>&gt; 
<DIV></DIV>&gt;But on the JSP after, there are no messages displayed. I know
the 
<DIV></DIV>&gt;answer why, and that is because "redirect=true". However, this
is the 
<DIV></DIV>&gt;only way I can forward to another action class in iPlanet.

<DIV></DIV>&gt; 
<DIV></DIV>&gt;Anyone know of a workaround to carry these messages into the
next page? 
<DIV></DIV>&gt;Can I check the request in "editTimesheet" to see if messages
exist, and 
<DIV></DIV>&gt;if so - add them to the request again? 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Thanks, 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Matt 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV></mailto:struts-user@jakarta.apache.org></mailto:struts-user-unsubscribe@jakarta.apache.org></mailto:struts-user-help@jakarta.apache.org></div><br
clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html>

Mime
View raw message