I would like to know how to implement sessions in servlets..I know the basics....
Actually what i am doing is the foolowing
      String User_Id=session.getValue("User_Id").toString();

if(User_Id == null || User_Id == "") {
// Get the request-dispatcher for logging
RequestDispatcher login=
      getServletContext().getRequestDispatcher(
          "/Login.jrun");

    if (login!= null)
        try {
            login.include(request, response);
        } catch (IOException e) {
        } catch (ServletException e) {
        }
}
 
in a servlets that requires authentication before it is displayed ( and there are many )
 
 
But it is giving a null pointer exception
 
And if I open up another browser window( Ctrl + N ) and login...then the form is printed...something is wrong in the first String declaration...So how to implement it ?
 
What is wrong here ?
 
i am using JRUN 2.3.3/IIS 4.0, jdk1.2.1, jsdk2.1
 
Gautam

Reply via email to