user1878804
user1878804

Reputation: 41

Struts 1.x Java- form data gets lost

My problem is, I have a jsp page(say one.jsp) which contains fields(eg: name, city etc) and after I hit on submit button, a new jsp(two.jsp) is opened in a new tab it contains a radio button 'I accept'. when the user now clicks on this radio button, the business logic should get executed. But the problem is the form values of one.jsp(values of name, city etc) are lost.

opening of the new jsp page using window.open is not a new request to the server. I wonder why the form values are lost.

Upvotes: 4

Views: 1584

Answers (2)

Suresh U
Suresh U

Reputation: 463

You are going from from one jsp to another jsp.But form values processed from one jsp to another jsp only>but you are expecting that values to submit form.

So you can do one thing you have get that values using request.getParameter();

and then you have to set that values to which you need.

Upvotes: 1

ashwinsakthi
ashwinsakthi

Reputation: 1956

Since you are using Struts 1 ,Please make sure you declare the fields whose values are to be retained in the ActionForm of the "I Accept" action and do set the values as Form2.setName(Form1.getName());

Or You have to maintain these values as hidden fields in two.jsp.

I guess the above two points would help you !

Upvotes: 1

Related Questions