HttpSession session = request.getSession(false); if (session == null){ response.sendRedirect("/dbproj/login.jsp"); } else { response.sendRedirect("/dbproj/menu.jsp"); }