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

你可能感兴趣的:(xml,struts)