struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Ravenberg" <>
Subject RE: Confirmation page
Date Fri, 03 Aug 2001 13:00:34 GMT
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 []
Sent: Thursday, August 02, 2001 6:16 PM
Subject: RE: Confirmation page

I think you misunderstood the scope of request. I think you have the
following workflow diagram:

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
1. Make the FormBean's scope be "Session".
2. Put the information of the formBean as hidden fields in

Hope this will be helpful.


-----Original Message-----
From: Yuriy Zubarev []
Sent: Thursday, August 02, 2001 2:37 PM
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

View raw message