File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

populate the form field with the submitted input

 
San Smith
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 58
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have yu figured out how to implement that, I have the same scenario....


TIA
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
vinitha simon
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic