b*g 发帖数: 644 | 1 eading cookies from a servlet is quite easy. You can gain
access to any
cookies sent by the browser from the
javax.servlet.http.HttpServletRequest
passed to the servlet's doGet, doPost, etc methods.
HttpServletResponse
offers a method, Cookies[] getCookies() which returns an
array of Cookie
objects.
However, if no cookies are available, this value may be
null, so be sure
to check before accessing any array elements.
// Check for cookies
Cookie[] cookie_jar = request.getCookies();
// Check to see |
|