首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

struts1.x-学习札记五

2012-10-28 
struts1.x--学习笔记五一 implict Action which in struts 1. DispatchActionAction element1) path ..

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

热点排行