my dog learned polymorphism*
The moose likes Struts and the fly likes Saving user enter values in a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Saving user enter values in a form" Watch "Saving user enter values in a form" New topic
Author

Saving user enter values in a form

Andy WongK
Greenhorn

Joined: Jun 27, 2005
Posts: 3
I have a struts form. Inside the form, there is a hyperlink that will redirect the user to the "Create email address" page, which the user can submit the 2nd page to create the email address. Once the submission is completed, it will redirect back to the first page. Now my problem is, any info the user enters on the first page is lost since it is a hyperlink redirect, not form submission so Struts won't populate the form bean on the first page.

Any suggestions on how to solve the problem?
michelle Wang
Ranch Hand

Joined: Jan 12, 2004
Posts: 65
Hi, for your pbm, I have done a similer one and it works.

U said Once the submission is completed, it will redirect back to the first page, but it is a hyperlink redirect. I use meta to redirect the page to an action but not a static page, like this:

<META HTTP-EQUIV="refresh" CONTENT="0;URL=http://localhost:8080/myApp/action/ShowEntryFormAction.do">

So I guess you can do this:
I believe to display the first page (which is that form), you should have an action class right? So just in the create email page (second page), you redirect it to call your first page's action class again, so all the form Bean's info will be displayed again.

Hope this helps.


michelle Wang <br />SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Saving user enter values in a form
 
Similar Threads
Remember Form values in Redirect
Struts 2: Forms with multiple submit buttons - Best Practice?
Need help with a servlet problem
data struts 2 form being lost!!
Hyperlink control in MIDP?