struts中ActionServlet的返回值疑问

来源:百度知道 编辑:UC知道 时间:2024/06/16 13:08:25
比如我有2个ActionServlet:aSer,bSer。

aSer继承DispatchAction,有如下两个方法:
public ActionForward doLogin(...)
public ActionForward doRegister(...)

bSer继承Action,只有一个默认方法:
public ActionForward execute(...)
---------------------------------------------------------------
我想问是,在bSer的execute(...)中return 到aSer中的doLogin(...),
请问该怎么写

我是用struts1.2

aSerForm forms = (aSerForm)form;
//把你的aSer中login方法中所需要的参数设置到forms里
aSer.login(mapping, forms, request, response);
//login方法所返回的地址 return mapping.findForward("");

这么写不知道你能不能看懂 我第一次用这个的时候觉得
这么写很有意思。

return new ActionForward("aSer.do?method=doLogin",true);

aSer.do就是你在struts-config.xml文件中配置的这个Action的path