求解答No result defined for action myaction.LoginAction and result success错误

struts.xml配置文件:

<struts>
<package name="myaction" namespace="/" extends="struts-default">
<action name="userinfo" class="myaction.LoginAction">
<result name="login">login.jsp</result>
<result name="manage">manage.jsp</result>
<result name="xiaoshou">xiaoshou.jsp</result>
<result name="register">register.jsp</result>
</action>
</package>
</struts>


login.jsp登录界面

<form action="userinfo" method="post" >
用户名:<input type="text" name="eid"><br>
密&nbsp;&nbsp;&nbsp;码:<input type="password" name="password"><br>
权&nbsp;&nbsp;&nbsp;限:
<input type="radio" checked="checked" name ="aa">管理员
<input type="radio" name ="aa">销售员<br>
<input type="button" value="注册" οnclick="toRegist()">
<input type="submit" value="登录" >
</form>


loginaction:

package myaction;


import com.opensymphony.xwork2.ActionSupport;


import action.User;
import dao.LoginDao;


public class LoginAction extends ActionSupport{
private User ui;
private LoginDao dao = new LoginDao();
public User getUi() {
return ui;
}
public void setUi(User ui) {
this.ui = ui;
}

public String login(){
if(dao.login(ui)){
/*if("admin".equals(ui.getRole())){*/
return "manage";
/*}
else{
return "xiaoshou";
}*/

}else{
this.addFieldError("ui.eid", "错误");
return "login";
}
}
}

logindao:

package dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import action.User;
import until.JdbcUtil;


public class LoginDao{
public boolean login(User ui){
boolean flag = false;
ResultSet rs = JdbcUtil.querySql("select * from user2 where eid=? and password=?", ui.getEid(),ui.getPassword());
try {
while(rs.next()){
flag = true;
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return flag;
}

}


也有实体类user.java到底是哪里的问题  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值