我正在尝试根据所选复选框的数量打印行(大约50个字段)。如果选择了两行,那么在下一页中我必须打印每行的所有50个值。
如果它只是一行,我就能成功打印。 但是不能为多行做同样的事情。
我的控制器类代码如下:
RequestMapping(value = { "dispo/searchDisplay.do" }, method = RequestMethod.GET)
public String selectForm(ModelMap model,
@RequestParam("cid") int warrantsId) {
az.dps.adrs.web.domain.HwrsWarrants hwrsWarrants = hwrsWarrantsService.setLookupValues(hwrsWarrantsService.find(warrantsId), getAuthentication());
HwrsWarrantsResult searchResults = hwrsWarrantsService.select(hwrsWarrants,TRANSACTION_TYPE_HWRS_WARRANTS_DISPLAY,getAuthentication());
Map<String, Object> results = searchResults.getSearches();
model.addAttribute("hwrsWarrants", hwrsWarrants);
model.addAttribute("resultSet", results);
model.addAttribute("results", hwrsWarrantsService.find(warrantsId));
model.addAttribute("transactionType", TRANSACTION_TYPE_HWRS_WARRANTS_DISPLAY);
return "searchDisplay";
}
@RequestMapping(value = { "dispo/searchDisplay.do" }, method = RequestMethod.POST)
public String selectForm(ModelMap model,
@ModelAttribute("hwrsWarrants") HwrsWarrants hwrsWarrants) {
HwrsWarrantsResult searchResults = hwrsWarrantsService.select(hwrsWarrants,TRANSACTION_TYPE_HWRS_WARRANTS_DISPLAY,getAuthentication());
Map<String, Object> results = searchResults.getSearches();
RequestContextHolder.currentRequestAttributes().setAttribute("results", results, RequestAttributes.SCOPE_SESSION);
RequestContextHolder.currentRequestAttributes().setAttribute("hwrsWarrants", hwrsWarrants, RequestAttributes.SCOPE_SESSION);
model.addAttribute("results", results);
model.addAttribute("hwrsWarrants",hwrsWarrants);
model.addAttribute("transactionType", TRANSACTION_TYPE_HWRS_WARRANTS_DISPLAY);
if (searchResults.isTooManyRows())
model.addAttribute("errorMessages", getTooManyRowsWarning(searchResults.getMaxRows()));
return "searchDisplay";
}
在我的jsp中,我试图像这样迭代:
<c:forEach items="${results}" var="results">
<table width="100%" cellspacing="0" class="RecSrcAll" cellpadding="2" border="0">
有人可以帮帮我吗?