```
protected void doGet(HttpServletRequest request,
    HttpServletResponse response) throws ServletException, IOException {

request.getSession().invalidate();
response.sendRedirect(request.getContextPath() + "/login.jsp");
}

```

I tried this code for logout option but, i need automatic logout when the system idle for 1 or 2 minutes can any one help me to solve this problem....