This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi all, i am working on tomcat webserver, i am created new session in servelt using HttpSessions and putting some values in the session and when i try to access these session value in JSP page it is giving the value as null i don't know why. my servlet code is like... . . HttpSession session = req.getSession(true); String dsn= getInitParameter(); session.putValue("dsn",dsn); . . when i try to access the session in my JSP page as . . String sesvalue = (String)session.getValue("dsn"); out.println(" session value "+sesvalue); . . it is displays the null value can any one help as how to solve this problem. thank in advance
getValue and putValue are deprecated !. They will return null value from Version 2.2. So as Dayanad indicates use getAttribute and setAttribute. For further clarification refer Servlet API documentation. regards holla.
Hi Dayanand i am using jdk1.2.2 so when i try to use the method session.setAttribute("string",object); it is not compiling and giving the error setAttributes(java.lang.String, java.lang.Object) not found in interface javax.servelt.http.HttpServlet. so do u want me to change jdk version? and also can u please tell me how to set initial parameters for web.xml file on tomcat webserver. thankq vishnu