public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
String id = req.getParameter("uid");
String pwd = req.getParameter("pwd");
User u = new User();
u.setUid(id);
u.setPwd(pwd);
LoginService ls = new LoginServiseimpl();
System.out.println("2");
User user = ls.logService(new User());
System.out.println("1");
这一段代码到 User user = ls.logService(new User());这里就执行不下去了
但是测试
public class Test1 {
public static void main(String[] args) {
String id = "2";
String pwd = "2222";
User u = new User();
u.setUid(id);
u.setPwd(pwd);
LoginService ls = new LoginServiseimpl();
User user = ls.logService(u);
System.out.println("id:" + id + "pwd" +pwd);
if(user == null){
System.out.println("id和密码不一致");
}else{
System.out.println(user.toString());
}
}
}
就能狗执行下去 这是为什么啊
有没有友友懂啊