modelAttribute="record"作用

modelAttribute="record"作用

modelAttribute="record"的作用是什么哦?
<
form:form id="admin-form" name="addForm" action="/claim_voucher/check" modelAttribute="record">
   <form:hidden path="claimVoucherId" />
   <div class="panel-body bg-light">
       <div class="section">
           <label for="comment" class="field prepend-icon">
               <form:input path="comment" cssClass="gui-input" placeholder="备注..."/>
               <label for="comment" class="field-icon">
                   <i class="fa fa-lock"></i>
               </label>
           </label>
       </div>
       <div class="panel-footer text-right">


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕小班 2021-05-11 11:44:26

同学你好,modelAttribute:绑定后台传过来的数据。这里是通过modelAttribute来传递。

使用spring提供的form表单时,会方便前后端数据的交互,比如:在页面显示数据时直接使用path标签就可以读取modelAttribute中的属性,从而在页面显示数据。

在当前小节的页面中传递key为record的数据到页面中

http://img1.sycdn.imooc.com//climg/6099fd540907525810400453.jpg

http://img1.sycdn.imooc.com//climg/6099fd90094a215411490258.jpg

祝学习愉快!

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师