// get session HttpSession session = request.getSession(); // get session attribute for authentication Boolean authenticated = (Boolean) session.getAttribute("authenticated"); response.setContentType("text/html"); String docType = ""; String html = "\n"; PrintWriter clientOutput = response.getWriter(); // generate the response document clientOutput.println(docType); clientOutput.println(html); if (authenticated == null ) { clientOutput.println("
You are not supposed to be here. You must login first.
"); clientOutput.println(""); clientOutput.println(""); } else { clientOutput.println("Welcome to the promised land!: