struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Ravenberg" <aravenb...@benefitsxml.com>
Subject RE: Confirmation page
Date Fri, 03 Aug 2001 13:04:39 GMT
Sorry, every one just noticed the follow up on this thread, didn't see it in
th e 112 msgs I got this morning :)

Aaron Ravenberg

-----Original Message-----
From: Aaron Ravenberg [mailto:aravenberg@benefitsxml.com]
Sent: Friday, August 03, 2001 9:01 AM
To: struts-user@jakarta.apache.org
Subject: RE: Confirmation page


If you can use JavaScript it would be the most simple solution. It seems
that writing a confirm form and action to accommodate every page you want
this functionality in might be a little much when you compare it to a few
lines of JavaScript.

As mentioned in another reply you can use the <bean:message> with in the
JavaScript code.

Aaron Ravenberg


-----Original Message-----
From: Liu, Xin [mailto:Xin.Liu@broadvision.com]
Sent: Thursday, August 02, 2001 6:16 PM
To: struts-user@jakarta.apache.org
Subject: RE: Confirmation page


Hi,
I think you misunderstood the scope of request. I think you have the
following workflow diagram:
first_page(browser)-->Server_process1-->Confirmation_page(browser)-->Server_
process2

I think your Java code is running during "Server_process1", and it puts your
first_page's information into your bean, which is in the request scope.
After the control is transfered  to Confirmation_page. All information in
the request scope is destroyed. So when you come back to Server_process2, it
will tell you: Cannot find the form bean in the request scope.

You have several ways to keep the formBean information available in
Server_process2.
1. Make the FormBean's scope be "Session".
2. Put the information of the formBean as hidden fields in
Confirmation_page.

Hope this will be helpful.

Xin


-----Original Message-----
From: Yuriy Zubarev [mailto:yuriy_zubarev@yahoo.ca]
Sent: Thursday, August 02, 2001 2:37 PM
To: struts-user@jakarta.apache.org
Subject: Confirmation page


Hello everyone,

I have a form (in request scope) with submit and cancel
buttons and after pushing either of them I should display
a confirmation dialog ("Are you sure?") and depending on user's
choice I have to perform the actual action 'submit' or 'cancel'
if user clicks 'yes' and have to return to the same page with
form if user clicks 'no'. The need of this confirmation routine
is questionable but this is not the point in this case, the point
is how to preserve everything you have in your request while
making this trip.

I tried to do this in my action which calls confirmation
page and confirmation page itself (as scriplet):

java.util.Enumeration enum = request.getAttributeNames();

while (enum.hasMoreElements()) {
  String atName = (String) enum.nextElement();
  request.setAttribute(atName, request.getAttribute(atName));
}

But this didn't help because if I click 'no' button (a link
technically speaking, which leads me to the jsp page with form)
I get an error 'No bean found under attribute key userForm'

I would appreciate any suggestion related to this problem.

Thank you for your time.

Best of luck,
Yuriy Zubarev



__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/


Mime
View raw message