package io.bitbucket.NombreDeUsuario.jee03.servlets; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet( urlPatterns = { "/ServletLecturaCookies", "/lectura-de-cookies" } ) public class ServletLecturaCookies extends HttpServlet { private String tablaHtmlCookies(HttpServletRequest request) { StringBuffer tablaHtml = new StringBuffer(); Cookie[] galletitas = request.getCookies(); tablaHtml.append("
getName() | "); tablaHtml.append("getValue() | "); tablaHtml.append("getMaxAge() | "); tablaHtml.append("getDomain() | "); tablaHtml.append("getPath() | "); tablaHtml.append("getSecure() | "); tablaHtml.append("
---|---|---|---|---|---|
" + cookie.getName() + " | "); tablaHtml.append("" + cookie.getValue() + " | "); tablaHtml.append("" + cookie.getMaxAge() + " | "); tablaHtml.append("" + cookie.getDomain() + " | "); tablaHtml.append("" + cookie.getPath() + " | "); tablaHtml.append("" + cookie.getSecure() + " | "); tablaHtml.append("