是否可以将@CookieValue 放在参数对象中?我似乎无法让这个工作缺少什么?
@RequestMapping(value = "/Users", method = RequestMethod.GET)
@ResponseBody
public Response getAllActiveUsers(CookieParameters parameterObject) {
return getUserImpl.getAllActiveUsers(parameterObject.userToken,
parameterObject.loggedInUserId);
}
这是参数对象类。
public class CookieParameters {
public String userToken;
public String loggedInUserId;
public CookieParameter(
@CookieValue(value = "Token", defaultValue = "") final String userToken,
@CookieValue(value = "LoggedInUserId", defaultValue = "") final String loggedInUserId) {
this.userToken = userToken;
this.loggedInUserId = loggedInUserId;
}