jersey cookie的读取比较简单代码如下.
public void before(JoinPoint jp) throws Exception {
System.out.println("before start");
Map<String, Cookie> cookies = ((WebApplicationContext) jp.getArgs()[0])
.getContainerRequest().getCookies();
for (Map.Entry<String, Cookie> cookie : cookies.entrySet()) {
if("token".equals(cookie.getKey())){
System.out.println(cookie.getValue().getName() + "|" + cookie.getValue().getValue());
}
}
}