欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
使用ModelDriven action
Model-Driven vs. Field-Driven
  two types of Actions possible:
  1. Model-driven
      Action has methods returning your model classes (myAction.getUser())
      Fields in the view are fields of your model
      Views refer directly to your model (property=‘user.name’)
      Excellent because it allows model reuse

  2. Field-driven
    Action has fields of its own, which are fields in the view
    execute() collates fields and interacts with the model
    Views refer to action fields (property=‘daysTillNextBirthday’)
    Useful where form is not parallel to model

 As we can see in our Action, the two can be mixed


ModelDriven Interface
XWork / WebWork also supports modeldriven Actions more directly
The ModelDriven Interface has one method:
        public Object getModel()
Properties of the model will be directly available, i.e. “name” instead of “user.name”
Applies to UI tags, form field names, etc.


步驟:
(1)Action implements ModelDriven接口
(2)實(shí)現getModel()方法:
    public Object getModel() {
        return user;
    }
(3)將jsp頁(yè)面上user.name 改成name
(4)在xwork.xml中,
<pancakmaegsep ancaem=e"=/"eexx22""> extends="webwork-default"
  <action name="main" class="com.opensymphony.xwork.ActionSupport">
    <result>/model/form.jsp</result>
</action>

<action name="HelloWorld" class="example.ex2.HelloWorldAction">
    <interceptor-ref name="model-driven"/>
    <interceptor-ref name="defaultStack"/>
    <result>/model/success.jsp</result>
    <result name="input">/model/form.jsp</result>
</action>
</package>
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
ModelDriven使用
Struts2之ModelDriven的使用
模型驅動(dòng) ModelDriven
2.5.1 Action實(shí)現ModelDriven接口后的運行流程
【Struts2進(jìn)階】Struts2深度解析ModelDriven原理
Struts2教程
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久