`
sd8089730
  • 浏览: 253572 次
  • 性别: Icon_minigender_1
  • 来自: 吉林
社区版块
存档分类
最新评论

LookupdispatchAction

 
阅读更多

让 action中的类继承 lookupdispatchaciton

去掉execute()方法 然后实现 Map getKeyMethodMap()方法

 ----------------------------------------------------------------------------------------------

Map getKeyMethodMap(){

Map map=new HashMap()

map.put ("user.login.insert","insert");

map.put ("user.login.delete","delete");                         “user.login.delete”     ←

return map;                                                                                                        ↑

}                                                                                                                          ↑

这里进行选择→↓

public ActionForward insert(mapping,form,request,response)

 

public ActionForward insert(mapping,form,request,response)

 

                                                                                                                                 ↑

其中 key值 是从properties 中取

user.login.insert   ==user insert

user.login.delete  ==user delete

也就是下面的 → 后面的                                                                                              ←↓

-------------------------------------------------------------------------------------

在一个表单中有多个提交按钮

页面中 多个 按钮 情况()

input type=submit   name="type" value="user insert" → 找 对应properties 的 key→↑

input type=submit   name="type" value="user delete"

-------------------------------------------------------------------------

action 中的配置

path="lookup" parameter="type"(写按钮的name)  type="就是那个继承至lookup那个类"

 

提交的时候就是提交到 lookup.do  然后 他会自动根据  按钮的问题 进行选择

 

---------------------------------------------------------------------------------------

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics