package cn;
import java.util.*;
public class A
{
private String target;
private String tips;
public A(String target,String tips){
this.target=target;
this.tips=tips;
}
public void setTarget(String target){
this.target=target;
}
public String getTarget(){
return target;
}
public void setTips(String tips){
this.tips=tips;
}
public String getTips(){
return tips;
}
}
package cn;
import java.util.*;
public class B {
public List get(){
List li=new ArrayList();
A a =new A("1","a");
A b = new A("2","b");
A c = new A("3","c");
li.add(a);
li.add(b);
li.add(c);
return li;
}
}
would like to ask how to iterate jsp page using
------ Solution ------------------------------------ --------
<s:iterator value="new cn.B().get()">
${target}:${tips}<br/>
</s:iterator>
------ For reference only ------------------------ ---------------
can use ! Thank you !
没有评论:
发表评论