我主要是想得到返回的LIST 取出里面的值 放入MAP 中,写入拦截器的方法中。

解决方案 »

  1.   

    自己写个方法 在返回list之前 吧list放在该方法不就行了吗
      

  2.   

    public Map getCurrentUserModuleHash() {    这是我的方法public List<SPModule2> getSpmList() { 这是ACTION 我想得到的list 集合
      

  3.   

    public Map getCurrentUserModuleHash() {
        spmodule2=new ArrayList<SPModule2>();
         spmodule2=new SPMAction().getSpmList();
    for (SPModule2 sp : spmodule2) {
    //new SPMAction().getOx(sp);
    System.out.println("sp:"+sp.getWebPath());
      

  4.   

    用的是struts几?
    1.struts2的话很简单,只要配置一下就可以了,具体搜一下struts2拦截器,例子很多。2.struts1的话,把list的结果集放到session中,然后在拦截器里面的session取值,再处理放到MAp中;3.如果struts是有spring管理的话,在拦截器中用ApplicationContext获取相应的Action bean,再调用获取list的方法。