title: HTTP method GET is not supported by this URL
body: <p>i am having trouble with my code as i am accessing the logout servlet from a jsp page's hyperlink.</p>
  
  <p><strong>Jsp page link:</strong></p>
  
  <p> href="/logout" </p>
  
  <p><strong>logout Servlet:</strong></p>
  
  <pre><code>public class logOut extends HttpServlet{
  
  public void doGET(HttpServletRequest req, HttpServletResponse resp)
          throws IOException {
  
      resp.setContentType("text/html"); 
      System.out.println("log out servlet");
      HttpSession session = req.getSession(false);
      if (session != null) {
          session.invalidate();
      }
      resp.sendRedirect("/signin.jsp");
  }
  }
  </code></pre>
  
  <p>but i am having the following error :</p>
  
  <pre><code>HTTP ERROR 405
  
  Problem accessing /logout. Reason:
  
  HTTP method GET is not supported by this URL
  </code></pre>
  
  <p>please help me.....</p>