Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 一个页面中有多个DisplayTag表_Spring_Displaytag - Fatal编程技术网

Spring 一个页面中有多个DisplayTag表

Spring 一个页面中有多个DisplayTag表,spring,displaytag,Spring,Displaytag,我将spring与appfuse框架一起使用,我希望在我的JSP页面中显示两到三个表。像下面这样 <display:table name="users" cellspacing="0" cellpadding="0" requestURI="" id="names" class="table" export="true">.....</display:table> 但是,由于控制器只能返回一个对象集合,因此我必须为不同的表使用两个不同的底层对象 不知道该怎么办 干杯,

我将spring与appfuse框架一起使用,我希望在我的JSP页面中显示两到三个表。像下面这样

<display:table name="users" cellspacing="0" cellpadding="0" requestURI="" id="names" class="table" export="true">.....</display:table>
但是,由于控制器只能返回一个对象集合,因此我必须为不同的表使用两个不同的底层对象

不知道该怎么办

干杯,
J

您确实需要阅读ModelAndView的文档。尽管控制器只能返回单个ModelAndView,但该模型可能包含许多属性

ModelAndView mav = new ModelAndView(getSuccessView());
mav.addObject(Constants.PROFILE, fetchData());
mav.addObject(Constants.SOMETHINGELSE, fetchOtherData());
return mav;

ModelAndView mav = new ModelAndView(getSuccessView());
mav.addObject(Constants.PROFILE, fetchData());
mav.addObject(Constants.SOMETHINGELSE, fetchOtherData());
return mav;