My 2 forms (one with a submit button) work well in passing values of variables in one page to the next. Page1.jsp has input text controls and Page2.jsp does not have form controls. In this situation, I can play around with variables obtained from page1.jsp in page2.jsp.
I decided to put a form button control and one input text control in page2.jsp. What now happens is that I can get the variables from page1 but when I click the submit button I included in page2.jsp, the values of the variables turn to 'null'. I have verified this using out.println statements. my code is as follows:
String Page1Input = request.getParameter("Index");
out.println(Page1Input); //produces the results but when button is clicked, it turns to 'null'
I want to use Page1Input in the code when button in page2.jsp is clicked. It seems like the submit button refreshes page2.jsp so that I lose the obtained data.
How can I resolve this??