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




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........ 


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.




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


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










©2024 concretepage.com | Privacy Policy | Contact Us