@RequestMapping("/judge")
public String judgeLogger(@RequestParam String userName, @RequestParam String password, @RequestParam String sex, RedirectAttributes redirectAttributes) {
// 乱码解决方法
try {
String name = new String(userName.getBytes("iso-8859-1"), "UTF-8"); String s = new String(sex.getBytes("iso-8859-1"), "utf-8");
//--------------------------------------------------------------------------------
if (name != null && password != null && s != null) {
if (loggerService.judgeLogger(name)==1) {
redirectAttributes.addFlashAttribute("userName",name);
redirectAttributes.addFlashAttribute("password",password);
redirectAttributes.addFlashAttribute("sex",s);
return "redirect:/log.do";
}
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return "404";
}
return "404";
}