action怎么声明session 然后JSP怎么获取session  访问页面就能获取 不需要接口的传送SSH2

解决方案 »

  1.   

    有好多种方法,你可以去实现SessionAware接口,然后再定义一个Map的成员变量,比如:Map<String, Object> session; 再实现SessionAware接口中的
    setSession(Map<String, Object> arg0) {
    this.session = arg0;
        }
    然后在action中给session赋值就行了,其它的都不用你做了
      

  2.   

    或者
    ActionContext.getContext().getSession();
    Map<String, Object> session;
    ActionContext.getContext().setSession(session);
      

  3.   

    ActionContext.getContext().getSession()