当前位置: 代码迷 >> Java Web开发 >> struts1 中Action需要向页面传递对象的有关问题
  详细解决方案

struts1 中Action需要向页面传递对象的有关问题

热度:10650   发布时间:2013-02-25 21:07:22.0
struts1 中Action需要向页面传递对象的问题
举个例子,我有个user.do的Action,在该Action中从数据库中查找出所有的user对象,为List类型,处理完后需要返回user.jsp页面。那么我怎么在user.jsp页面上取出所有的user对象呢?我都是放在session中的,还有没有其他方法?放到request作用域中。。。用C标签或者S标签的iterator标签,或者使用out标签,items设置为list就行C标签和S标签都可以实现啊!
引用:
C标签和S标签都可以实现啊!
+1放在request里面,用jstl的forEach表签,不用标签的话可以脚本元素代码段<%java代码,可以用for循啦> 显示页面是jsp能这样用,本人认为用标签比较好                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
  相关解决方案