Result of Cookie Setting Servlet
79
Servlets
www.corewebprogramming.com
Simple Cookie Viewing Servlet
public class ShowCookies extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String title = "Active Cookies";
out.println(ServletUtilities.headWithTitle(title) +
"\n" +
"" + title +
"\n" +
"\n" +
"\n" +
" Cookie Name\n" +
" Cookie Value");
80
Servlets
www.corewebprogramming.com
40
| |