Hi friends I have just started learning JSP.I created 3
jsp's namely 1.jsp,2.jsp and 3.jsp as below:
1.jsp:
<html>
<BODY>
<FORM name="form1" method="post" action="2.jsp">
A:<INPUT type="text" name="a" id="a">
B:<INPUT type="text" name="b" id="b">
<INPUT type="submit" value="Go">
</FORM>
<%
String a = request.getParameter("a");
String b = request.getParameter("b");
session.setAttribute("a",a);
session.setAttribute("b",b);
%>
</BODY>
</HTML>
2.jsp:
<html>
<BODY>
<form name="form2" action="3.jsp" method="post">
C:<INPUT type="text" name="c">
D:<INPUT type="text" name="d">
<INPUT type="submit" value="Go">
</form>
</BODY>
</HTML>
3.jsp:
<html>
<BODY>
<P>
A:<INPUT type="text" value="<%=session.getAttribute("a")%>">
B:<INPUT type="text" value="<%=session.getAttribute("b")%>">
C:<INPUT type="text" value="<%=request.getParameter("c")%>">
D:<INPUT type="text" value="<%=request.getParameter("d")%>">
</P>
</BODY>
</HTML>
I want to print the values of text fields of 1.jsp and 2.jsp in 3.jsp I put the values of "a" and "b" in a session but I am able to retrieve those values into 3.jsp please help me in this regard
thanks in advance