2013-11-28 19:16:54 org.apache.struts2.dispatcher.Dispatcher error
严重: Exception occurred during processing request: null
java.lang.NullPointerException
at com.sun.proxy.$Proxy6.findUser(Unknown Source)
at com.lovo.action.UserAction.login(UserAction.java:58)
我把对象都输出来了 都不是null 但是还是要报nullpointException
------解决方案--------------------
public String login() throws Exception{
// ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
String str = "lose";
us = (UserService)ac.getBean("usi");
System.out.println("us="+us);
System.out.println("user="+user);
int i = us.findUser(user);
if(i>0){
ServletActionContext.getRequest().getSession().setAttribute("user", user);
str = "loginSuccess";
}
return str;
}
user 能打印出值吗,应该是user的问题
------解决方案--------------------
不好意思,没仔细看,不是这个原因