1

HttpSessionpreProcessメソッドでにアクセス/作成することは可能PreProcessInterceptorですか?

(レストイージー 2.3.4)

4

1 に答える 1

3

アノテーションを使用して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...
}
于 2013-08-13T19:56:38.547 に答える