一 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
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
理解Struts框架中的Action元素
深入解析Struts框架中的Action元素,包括隐式动作、映射动作、表单动作等核心组件及其属性作用,详细阐述了参数配置、路径设置、验证规则等内容,帮助开发者更好地理解和使用Struts框架。
1万+

被折叠的 条评论
为什么被折叠?



