ssm
public class UserController {
@Autowired
private IUserService userService;
@RequestMapping("/findAll.do")
public ModelAndView findAll() {
List<User>users=userService.findAll();
ModelAndView modelAndView=new ModelAndView();
modelAndView.setViewName("aa.jsp");
modelAndView.addObject("user",users);
return modelAndView;
}
@RequestMapping
public String login(User user){
Boolean flag =userService.login(user.getUsername(),user.getPassword());
if (flag){
return "redirect:/findAll.do";
}else{
return "drsb.jsp";
}