My question is why don't enter into if when acc.getUsername
equals "stringExample"
? When I print acc.getUsername()
this line ealier it shows its equals but dont go into if, why?
@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;
}