HttpSession
のpreProcess
メソッドでにアクセス/作成することは可能PreProcessInterceptor
ですか?
(レストイージー 2.3.4)
HttpSession
のpreProcess
メソッドでにアクセス/作成することは可能PreProcessInterceptor
ですか?
(レストイージー 2.3.4)
アノテーションを使用してHttpSession
を注入し、次のようにリクエストからセッションを取得することで、 にアクセスできます。HttpServletRequest
@Context
@Context
private HttpServletRequest servletRequest;
@Override
public ServerResponse preProcess(HttpRequest request, ResourceMethod method)
throws Failure, WebApplicationException
{
HttpSession session = servletRequest.getSession();
//Do something with the session here...
}