-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;
}
愚蠢的我,謝謝。它有助於 ;) –