I have to return values from two modelandview methods to a single jsp `mySoftwarelist.jsp` where i have two tables. Here i have two seperate methods for returning array list
ModelAndView getLegacySuiteList()
ModelAndView getSuiteList()
i returned the arraylist `mySoftwareList`,`mySoftwareLegacyList` to the same view `swl_mySoftwareList` as
public ModelAndView getSuiteList(HttpServletRequest request, HttpServletResponse response) throws Exception
{
ArrayList mySoftwareList = new ArrayList();
try{
MySoftwareListHelper mySoftwareListHelper = new MySoftwareListHelper();
userEmailAddr =user.getEmailaddress();
mySoftwareList = mySoftwareListHelper.getSuites(userEmailAddr);
}
catch(Exception e) {
e.printStackTrace();
}
ModelAndView mnv = new ModelAndView("swl_mySoftwareList","mySoftwareList",mySoftwareList);
return mnv;
}
public ModelAndView getLegacySuiteList(HttpServletRequest request, HttpServletResponse response) throws Exception
{
ArrayList mySoftwareLegacyList = new ArrayList();
try{
MySoftwareListHelper mySoftwareListHelper = new MySoftwareListHelper();
userEmailAddr =user.getEmailaddress();
mySoftwareLegacyList = mySoftwareListHelper.getLegacySuites(userEmailAddr);
}catch(Exception e){
e.printStackTrace();
}
ModelAndView mnv = new ModelAndView(「swl_mySoftwareList」,「mySoftwareLegacyList」,mySoftwareLegacyList); return mnv;如何從單個視圖中的兩個模型中獲取值
}
,但其只返回模型mySoftwareList
。 我希望來自這兩個arraylist的數據在相同的jsp上使用。
請向我們展示實際的方法,而不僅僅是個別的代碼行。 – skaffman
@skaffman嗨我已經添加了確切的方法 – anto