This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Struts and the fly likes populate the form field with the submitted input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "populate the form field with the submitted input" Watch "populate the form field with the submitted input" New topic
Author

populate the form field with the submitted input

San Smith
Greenhorn

Joined: Feb 10, 2008
Posts: 14
I have one form. That form has one submit button. I have to create a new button in that form say call "New button". When user submits that form it will display result page. That result page will have one back button. When I hit back button I can go back to that form again. After I go back to that form when I hit "New Button" the form field will fill up with the information what user just entered before submit. I am using JSP and Struts in my application. This functionality is basically need for the user so that user do not need to entered the same information again.

Can you please help me what I have to do for that?

Thank you very much for your help.
srinivas.b
Ranch Hand

Joined: Oct 26, 2006
Posts: 58
Hi

This is very basic application. You have to create one Action class , one ActionForm class (form bean)

and two jsp's, one is index and other one is result.

for index jsp use just normal action mapping action.

for result jsp use <html:link> and forwardAction and forward that to index page.then you will get what you want exactly.

Hope you understand my point.
San Smith
Greenhorn

Joined: Feb 10, 2008
Posts: 14
Thank you for your answer.

I am not sure whether I have described the scenario clearly or not. Below I have described it again. I have to create a new button in that existing application and when user hit that button then that form will be automatically fill out with the previously entered input.

Can you please explain your solution one more time? It is not clear for me. I am kind of new in Struts.

Scenario:
1.page1.jsp (user input form) -> page2.jsp (show progress bar) -> page3.jsp (result page) -> page1.jsp (using back button) -> In page1.jsp I have to create a new button say �Button1�. When user hit �Button1� then all the form field will be fill up with the information what user just typed before hit �Submit� button. This I have to do.

Thank you very much for your help.
vinitha simon
Ranch Hand

Joined: Dec 13, 2007
Posts: 64
Have yu figured out how to implement that, I have the same scenario....


TIA
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Creating pages, ActionForms and Actions that pass data from one to the other is the most basic part of Struts. Please don't take offense at this, but if you don't understand how to do this, you don't understand Struts well enough to write an application.

My advice would be to spend some time with one or more of the Struts tutorials before continuing with your application. Here is a link to some good ones.

http://wiki.apache.org/struts/StrutsTutorials


Merrill
Consultant, Sima Solutions
vinitha simon
Ranch Hand

Joined: Dec 13, 2007
Posts: 64
thanks Sima, I shall read the tutorials. I did resolve the issue, I should've put a link to the previous page, not a submit button, the UI had the code developed with a button, and I just modified that and realized the mistake much later !!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: populate the form field with the submitted input