reply to variable session problem
Your servlet is showing such an error because its cannot find any variable called session. In a jsp you need not to declare a session variable explicitly, but in a servlet you need to do it!
So before ou write :
declare your session variable first and then use it -
String name = session.getAttribute("name").toString();
Try this...it'll surely work!..
HttpSession session=request.getSession(false); // you may use true instead of false
String name =(String) session.getAttribute("name");
good luck! :)