struts1.x--学习笔记五

一 implict Action which in struts

1. DispatchAction
Action element
1) path =".." the directory which can come into this action.
2) type =".." the class of the action(completed directory)
3) parameter=".." the value of a hidden parameter.which nested in a request.

2. mappingAction

<form-bean>

1) name= ".." same as name which in Action element.
2) type= ".." the class of formAction
3) path=" " all the path is the same
</form-bean>

Action element

1) validate=".." if the value of this attribute is false,wiil not execute the input attribute ,and thow a Exception. usually use in MappingAction.
2) parameter=" " the name of method which defined in Action.
3) name= ".." if have ,the name of the formAction is name which defined in form-baen element .will execute ActionForm.
4) input= ".." in formAction ,if the result of return is not null,means did't passed the validate ,the system wiill transfor to the directory which defined in input attribute. if validation failed ,controller dispatch the request to this .

3. lookupAction

1) the button is named in resources file -----use <bean:message key="..."/> message.properities

2) in struts-config.xml, just write one action . same parameter attribute. same url. same type. maybe difference forward

3) override public Map getKeyMethodMap(). and in this method first new a map. then put into ("message.xxx(which from resources file)","xxx").

4) last , write a method like execute. but replace the method name with xxx. ok
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值