首先通过客户的请求,在此其间通过action的判断请求(struct-config.xml)识别路径
对确认后的perform来调用表单数据(actionForm)当然还要通过一个facade来处理

解决方案 »

  1.   

    一般是在你的Action里setAttribute
      

  2.   

    嗯。流程yeshucheng(叶澍成)已经说了。
      

  3.   

    boardlist这个对象是在页面打开就已经setAttribute了吗?
    那应该在什么时候做setAttribute动作..
    有点搞清楚,谁能提供一个简单的例子给我看看,面下万分感谢,分不够可以加..
      

  4.   

    例如:有一个Bean
    //: package:TestBean.java
    public final class TestBean {

    private String userId = "";
    private String userName = "";

    // Setter And Getter 
    public void setUserId(String userId) {
    this.userId = userId;
    }
    public String getUserId() {
    return this.userId;
    }

    public void setUserName(String userName) {
    this.userName = userName;
    }
    public String getUserName() {
    return this.userName;
    }
    } ///:~在你的perform中可以这样写:
    List testList = new ArrayList();
    for(int i = 0; i < 5; i++){
    TestBean test = new TestBean();
    test.setUserId(""); // Id Value From Table
    test.setUserName(""); // Name Value From Table
    testList.add(test);
    }
    request.setAttribute("myList",testList);//页面中这样写
    <logic:iterate id="myContent" name="myList">
      <bean:write name="myContent" property="userId"/>
      <bean:write name="myContent" property="userName"/>
    </logic:iterate>
      

  5.   

    在action中定义的boardlist,然后setAttribute("boardlist",list);
      

  6.   

    那是不是要链接到action,做好setAttribute("boardlist",list);然后再foward到页面???
    是不是这样??
      

  7.   

    to:BlueFox2008(BlueFox),呵呵你前半段是对的,不过后半段就没有理解对了,这里还没有list的概念。要是说错了,请见谅
    建议楼主可以到:www.apache.org
    去看看有个版本叫:howto..
      

  8.   

    哦,我知道,你的意思是用logic:iterator的Collection属性吧,其实这个标签有好几种搭配的,可以用Collection,也可以用其他的,在我这里呢,放到Request里的东西是被当做Bean来处理的,如果他是个集合,那么logic:iterator就可以迭代出结果的.在页面中根本不用象
        List alist = (List)request.getAttribute("boardlist");
    这样做,还是让"j4sxw (HelloWorld,从头开始)"试试吧,呵呵!
      

  9.   

    要知道原理,简单啊,看看logic:iterate 这个的源代码就知道了,一清二楚.
    setAttribute是在action中进行,页面上取用这个比较好:
    <logic:iterate id="aBoardInfo" collection="boardlist" scope="request" > </logic:iterate>
    不用先取出来,不推荐在jsp中写java代码