虽然可以打开Users_login.jsp,但无论输入正确与否都报404错误,
没有任何报错信息,点击登录后就报404,控制台无任何输出,
下面是struts.xml配置信息
<package name="default" namespace="/" extends="struts-default">
</package>
<package name="users" namespace="/users" extends="struts-default">
<action name="*_*" class="com.zzz.sims.action.{1}Action" method="{2}">
<result name="login_success">/users/Users_login_success.jsp</result>
<result name="login_failure">/users/Users_login.jsp</result>
<allowed-methods>login</allowed-methods>
</action>
</package>
这是UsersAction配置;
package com.zzz.sims.action;
import com.opensymphony.xwork2.ModelDriven;
import com.zzz.sims.entity.Users;
import com.zzz.sims.service.UsersDAO;
import com.zzz.sims.serviceImpl.UsersDAOImpl;
public class UsersAction extends SuperAction implements ModelDriven<Users> {
/**
*
*/
private static final long serialVersionUID = 1L;
private Users user = new Users();
//用户登录动作
public String login() {
UsersDAO udao = new UsersDAOImpl();
if(udao.usersLogin(user)) {
System.out.println("com.zzz.sims.action login()信息正确!");
return "login_success";
}else {
System.out.println("com.zzz.sims.action login()信息错误!");
return "login_failure";
}
}
public Users getModel() {
System.out.println("getModel()执行了!");
return this.user;
}
}