This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I tried the following coding for understanding the Session.
Servlet1.java ------------- It is the form that having two fields 'name' and 'password'. When I submitted, it should go to servlet2.java with (Welcome name) and that screen will have another two fields 'age' and 'designation'. When I submitted this one, all the fields(name,password,age,designation) that are entered in the two forms should be displayed in the servlet3.java.
But it returning as Null for all the fields. If I am getting using request.getParameter("name"), it's working. but using session.getAttribute("name" is not working, returing null.
The code does a session.setattribute("Name"...) but gets the value using sess.getAttribute("user"). The key used used in the set and get operation is different. Replace sess.getAttribute("user") with sess.getAttribute("Name").