Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 16 public class LogoutServlet extends HttpServlet
- 17 {
- 18
- 19 public void doGet (HttpServletRequest request , HttpServletResponse
- response )
- 20 throws ServletException , IOException
- 21 {
- 22
- 23 // Get the session object first!
- 24 HttpSession session = request .getSession ();
- 25
- 26 // invalidate
- 27 session .invalidate ();
- 28
- 29 // Send back the page
- 30 PrintWriter out = response .getWriter ();
- 31 response .setContentType ("text/html");
- 32 out.println ("<HTML><BODY>");
- 33 out.println ("<h2> Logout Complete </h2>");
- 34 out.println ("<hr>");
- 35 out.println ("Your session has been invalidated.");
- 36 out.println ("<hr>");
- 37 out.println ("Click here to <a href=/servlet/CounterServlet2>start
- again </a>");
- 38 out.println("</BODY ></HTML >");
- 39 }
- 40
- 41 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement