常规绑定方式
Controller
@Controller
@RequestMapping(value = "/biz/plan/daily-plan")
public class DailyPlanController extends BaseController<DailyPlanExt, String> {
// 日志记录
private static final Logger log = LoggerFactory.getLogger(DailyPlanController.class);
@Resource
DailyPlanWebService dailyPlanWebService;
@RequestMapping(method = RequestMethod.GET)
public String list(Page<DailyPlanExt> page, Model model, @RequestParam Map<String, String> param) {
page.setResult(dailyPlanWebService.selectDailyPlanPagedList(page, param));
model.addAttribute("page", page);
return this.viewName("list");
}
}
注解
@Controller
@RequestMapping
@Resource
JSP页面
<table id="table" class="sort-table table table-bordered table-hover" data-async="false">
<thead>
<tr>
<th class="checkboxStyleTh"><input id="checkall" class="checkboxButton" type="checkbox"/>
</th>
<th class="serialStyleTh">序号</th>
<th style="width: 100px">日计划编号</th>
<th style="width: 100px">计划日期</th>
<th style="width: 100px">检测室</th>
<th style="width: 50px">是否确认</th>
</tr>
</thead>
<tbody>
<c:forEach items="${page.result}" var="m" varStatus="status">
<tr>
<td>
<input type="checkbox" class="check" name="ids" value="${m.id}"></td>
<td>
${status.index+1}
</td>
<td>
${m.dailyPlanNo}
</td>
<td>
<fmt:formatDate value='${m.planDate}' pattern='yyyy-MM-dd'/>
</td>
<td>
${m.laboratory.name}
</td>
<td>
<c:if test="${m.confirmationStatus==0}">
未确认
</c:if>
<c:if test="${m.confirmationStatus==1}">
已确认
</c:if>
<input name="confirmationStatus" type="hidden" value="${m.confirmationStatus}">
</td>
</tr>
</c:forEach>
</tbody>
</table>
JSTL标签
<c:forEach items="${page.result}" var="m" varStatus="status">
</c:forEach>
<c:if test="${m.confirmationStatus==0}">
</c:if>