title: Passing values from Servlet to my JSP
body: <p>I need to pass the String value h from Servlet to the jsp page. If login is success it will be redirected to success page else it need to display "Invalid login message" in login.jsp page</p>
  
  <pre><code>    if(success)
      {
          RequestDispatcher view=getServletContext().getRequestDispatcher("/Success.html");
          view.forward(request, response);
      }
      else
      {
          String h="Invalid Login";
          RequestDispatcher view=getServletContext().getRequestDispatcher("/Login.jsp");
          view.forward(request, response);
      }
  </code></pre>
  
  <p>I tried a lot, but its not working.</p>