JSP页面Table的数据绑定

常规绑定方式

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>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值