-1
我的问题是,为什么不进入,如果当acc.getUsername
等于"stringExample"
?当我打印acc.getUsername()
此行ealier它显示了它的平等,但不进入,如果,为什么呢?@ModelAttribute,为什么如果不工作?
@RequestMapping(value = "/login", method = RequestMethod.POST)
public ModelAndView checker(@ModelAttribute(value="acc") Account acc) {
System.out.println(acc.getUsername());
if(acc.getUsername() == "stringExample"){
System.out.println("aaa");
}
ModelAndView model2 = new ModelAndView("index.jsp");
return model2;
}
愚蠢的我,谢谢。它有助于 ;) –