dispatchAction 执行2次问题

来源:百度知道 编辑:UC知道 时间:2024/05/28 13:43:46
Action代码:
public class LoginAction extends DispatchAction{

public ActionForward login(ActionMapping mapping,
ActionForm actionForm,
HttpServletRequest request,
HttpServletResponse response){
log.info("系统进入LoginAction.login方法");
LoginForm form=(LoginForm)actionForm;
String url= new LoginDao().finduser(form);
log.info("系统离开LoginAction.login方法-返回test.jsp");
return mapping.findForward(url);

}
struts-config.xml:

<!--登陆 -->
<action path="/login" type="ldy.control.LoginAction" attribute="loginForm" name="loginForm" parameter="method" scope="request" validate="false">
<forward name="main" path="/mainPage/main.jsp" />
<forward name="login" path="/login.jsp" />
</ac

你是不是 jsp里面
<html:image onclick="xxxx"

这么写的? image自动提交的

这要看你js代码了

具体点呢

可以打个断点调一下

可能是你js触发是onclick,但是本身按钮也是一个submit吧?