Home  >  Forum  >  Java EE
Post New Query

keep form data without lost data by clicking back button from servlet


joined on
June 25,2013
Asked on October 23,2013
In first jsp i am filling the form data after that i am pressing submit button then goes to servlet. there i kept Back Button i tried to go first jsp by pressing back button i am losing the total form data what i have filled. My requirement is i have to see the total form data(first jsp) what i have entered before pressing the submit button. How to achieve it? Please Help me........ 
joined on
March 14,2013
Replied on October 23,2013

Hi Veerendra,
If you had used any framework like Struts or Spring, you would simply achieve your requirement. But I think you are using plan jsp and servlet.
So in this case you need to do by your self. 
Whenever you post your form, all data can be achieved by getParameter("name").
so you need to write in you jsp your like (I ma taking a text box for the example)
&lt%
 String name = (String) request.getParameter("name");
if(name==null ){
name="";
}

&ltinput type="text" name="name" value="&lt%=name%&gt"&gt
%&gt

I hope it will help you.

joined on
June 25,2013
Replied on October 23,2013

plz urget i need ur help..I am developping one module in small company using frameworks like spring+hibernate+jsp+servlet,what i am asking here is i am using front end jsp to generate form page after clicking next button request goes to eqvivalent servlet using ajax request,there i kept back button to come back to my jsp page without lost data what i entered fields in jsp page...this requirment i need because i want to confirm user entered form details ,whether his entered wrong/right to confirm that i am showing one screen to end user after seeing this,he will decide to save or modify,,,,,,,i think ur understand my requirement plzzzzzz urgent ur help...thank you i want to keep form data without lost entered details....plz
joined on
March 14,2013
Replied on October 23,2013

If you are using spring, then you can achieve your requirement easily.
In this case do not use html tag for your input data, use spring tad to create input data alike in your jsp.
Get the help by below URL.


Write Answer








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us