shiro login方法


public class UserController
{
    private static final Logger log = Logger.getLogger(UserController.class); 
 @Autowired
 private IUserService userService;
 
    @RequestMapping(value = "/doLogin")
    //public String doLogin(HttpServletRequest request)
 public String doLogin(@RequestParam("username") String userName, @RequestParam("password") String pwd, Map map)
 {
        boolean authorized = userService.isAuthorizedUser(userName, pwd);
        if(authorized)
        {
         List userList = userService.getAll();
      map.put("userList", userList);
            return "user/user_list";
        }
        else
        {
         return "login";
        }
    }
 
 @RequestMapping(value = "/getall")
 public String getAll(Map map)
 {
  List userList = userService.getAll();
  map.put("userList", userList);
  return "user/user_list";
 }

你可能感兴趣的:(shiro login方法)