package miniforum.action; 
 
import miniforum.IConstants; 
 
import javax.servlet.http.*; 
import javax.servlet.ServletException; 
import java.io.IOException; 
 
public class LogoutServlet extends HttpServlet { 
    protected void doGet(HttpServletRequest aRequest, 
            HttpServletResponse aResponse) 
            throws ServletException, IOException { 
        HttpSession session = aRequest.getSession(); 
        session.invalidate(); 
        aResponse.sendRedirect(IConstants.LOGIN_FORM); 
    } 
}
Back to Internet Programming with Java books's web site