本文采用spring3.0说明解决方案:
重点在:
RedirectView("/j_spring_security_check", true, false, true);//false代表以post方式提交请求
第二个参数觉得是否提交, 否则安全框架默认不允许get的方式提交。
@RequestMapping(value = "caLogin.html") public RedirectView caLogin(HttpServletRequest request, ModelMap model) throws Exception { String caStr=this.getCaStr(request); if(!StringUtils.hasLength(caStr)) throw new CAException(caStr+" CA服务器认证失败!请确认是否插入key"); User user=BeanHelper.getBean(UserService.class).getUserByCa(caStr); log.info("ca证书="+caStr+" ca用户="+user.getName()); model.put("j_username", user.getUsername()); model.put("j_password", user.getPassword()); return new RedirectView("/j_spring_security_check", true, false, true);//false代表以post方式提交请求 }