title: Create Session in Servlet and Use in JSP pages?
body: <p>I want Create Session in CheckForLogin Servlet and Use it in all JSP pages(For checking).
  What should Write in my JSP pages and instead of ......... in Sevlet.How to define Session in Servlet?</p>
  
  <pre><code>public void service(ServletRequest request,
                      ServletResponse response) throws ServletException, IOException {
  
      String email = request.getParameter("email");
      String password = request.getParameter("password");
      if (email.equals("") || password.equals("") || email == null || password == null) {
          request.getRequestDispatcher("Error.jsp?err=enterdata").forward(request,response);
      } else {
          UserBl userBl = new UserBl();
          if (userBl.checkUser(email, password)) {
              ..........................
               request.getRequestDispatcher("Home.jsp").forward(request, response);
          } else {
              request.getRequestDispatcher("Error.jsp?err=nulluser").forward(request, response);
          }
      }
  }
  </code></pre>