NullPointerException « Session « JSP-Servlet Q&A





1. session null pointer exception    coderanch.com

I have a jsp page that is baffling me. <%@ page session="true" %> <%! public String aUrl=null; public Vector domains= new Vector(); %> <% domains.add("1"); domains.add("2"); session.setAttribute("domains",domains); } System.out.println("Size of Domains=" + domains.size()); System.out.println("Session Domain Size=" + session.getAttribute("domains")); %> When I access this page the first time I have no problem. I open up another browser session a few minutes later ...