UserController
package com.zhongruan.controller;
import com.zhongruan.bean.User;
import com.zhongruan.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.List;
@Controller
@RequestMapping("/user")
public class UserController {
@Autowired
private IUserService userService;
@RequestMapping("/login.do")
public ModelAndView login(User user){
boolean flag = userService.login(user.getUsername(), user.getPassword());
ModelAndView modelAndView=new ModelAndView();
if(flag){
modelAndView.setViewName("main");
}else {
modelAndView.setViewName("../failer");
}
return modelAndView;
}
@Reques