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?
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.
Joined: Feb 10, 2008
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.
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.
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 !!!
subject: populate the form field with the submitted input