Interceptorでセッションを使うには

提供: tknotebook
移動: 案内検索

メインページ>コンピュータの部屋#Java>Struts2 Tips


Interceptor内でセッションを使うには intercept メソッドで以下のようにセッションを取得します。

@Override
public String intercept(ActionInvocation invocation) throws Exception {
    Map<String, Object> session = invocation.getInvocationContext().getSession();