当你在action里用了mapping.findForward("editaccount");这时就会指向/editaccount.do,
这样,struts会在struts-config里面找对应的,就像你上面的第二句话一样,会找到那个<action path="/editaccount"然后调用他指向的action,完成画面的迁移
这样,struts会在struts-config里面找对应的,就像你上面的第二句话一样,会找到那个<action path="/editaccount"然后调用他指向的action,完成画面的迁移
servlet元素里面设置的*.do的关系,如果为*.ww,那path="/editaccount.do"/就是*.ww了
<forward name="editaccount" path="/editaccount.do"/>
<forward name="placeorder" path="/placeorder.do"/>
<forward name="welcome" path="/WEB-INF/jsp/welcome.jsp"/>
</global-forwards>
为全局路径转发,即所有用这个配置文件的模块的Action中ActionForward的mapping.findForward("editaccount");指向/editaccount.do;
而通过配置文件的action-mapping中可以找到虚拟路径editaccount.do的实际处理Action为
toystore.controller.strutsactions.EditAccountAction。
太感谢了,你问了 我就不用问了 节省可用分了,我只有4百多分了
长知识
呵呵
再次感谢
说得对