ASP 2차원 배열 Cookie
2. ...
@SuppressWarnings("rawtypes")
Enumeration en = request.getHeaderNames();
while (en.hasMoreElements()) {
String name = (String) en.nextElement();
String value = request.getHeader(name);
// System.out.println( name + ":" + value +"<br>");
if (name.equals("cookie")) {
String cookieArr[] = value.split(";");
for (int i = 0; i < cookieArr.length; i++) {
String cookieStr = cookieArr[i];
if (cookieStr.trim().toUpperCase().startsWith("ISCREAM")) {
// System.out.println("cookieStr" +URLDecoder.decode(cookieStr, "UTF-8"));
String realCookie[] = URLDecoder.decode(cookieStr, "euc-kr").split("&");
for (int j = 0; j < realCookie.length; j++) {
String realArr[] = realCookie[j].split("=");
StringBuffer sbCookieStr = new StringBuffer();
String cookieParamName = "";
String cookieParamValue = "";
for (int k = 0; k < realArr.length; k++) {
if (k % 2 == 0) {
cookieParamName = realArr[k];
} else {
cookieParamValue = realArr[k];
cookieHt.remove(cookieParamValue);
cookieHt.put(cookieParamName , cookieParamValue);
log.info("namesb :: " + sbCookieStr.toString());
}
}
}
}
}
}