日期:2014-05-20  浏览次数:20638 次

很急...struts2里action传送一个对象过去,在jsp中怎么输出该对象的属性
封装类 supplier属性有id name ......等等

我的action里
public String viewSupplier(){
supplier=circulateSupplier();//查找到要输出的supplier
System.out.println("++++"+supplier.getID());//测试supplier是否为空
return "success";
}
我的jsp中如何获得supplier的各个属性(最好用struts标签)

我的做法: ${supplier.id}
  ${supplier.name}
为什么获得不到???????大大们帮忙啊

------解决方案--------------------
struts标签不支持el表达式
------解决方案--------------------
麻烦这位兄弟请使用OGNL表达式取值,如果不懂,请看Struts2中的ognl
------解决方案--------------------
ACTION VALUESTACK中的值是直接取的,Context中是前加#号,使用<s:property name="supplier.id"/>