while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
String[] values = getHeaderValues(request.getHeaders(name));
map.put(name, values);
}
map = new UnmodifiableContextMap(map);
}
break;
case SCOPE_COOKIE: {
HttpServletRequest request = getRequest();
map = DelegatedContextMap.createByNonThreadSafeHashMap();
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
String name = cookie.getName();
String[] values = mergeCookieValues(cookie, (String[]) map.get(name));
map.put(name, values);
}
}
map = new UnmodifiableContextMap(map);
}
break;
case SCOPE_REQUEST:
map = super.acquireMapForScope(SCOPE_DEFAULT);
break;
case SCOPE_QUERYPARAM_ALIAS:
case SCOPE_QUERYPARAM: {
HttpServletRequest request = getRequest();
map = DelegatedContextMap.createByNonThreadSafeHashMap();
Enumeration<String> paramNames = request.getParameterNames();
while (paramNames.hasMoreElements()) {
String name = paramNames.nextElement();
String[] values = request.getParameterValues(name);
map.put(name, values);
}
map = new UnmodifiableContextMap(map);
}
break;
case SCOPE_PATHVAR:
map = DelegatedContextMap.createByNonThreadSafeHashMap();
break;