@RequestMapping(value="/check", method=RequestMethod.POST)
public String check(ServletRequest theRequest, ServletResponse theResponse) {
HttpServletRequest request = (HttpServletRequest) theRequest;
HttpServletResponse response = (HttpServletResponse) theResponse;
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext());
CaptchaService captchaService = (CaptchaService) context.getBean("captchaService");
try {
String captchaID = request.getSession().getId();
logger.info("captchaID:"+captchaID);
String challengeResponse = request.getParameter("j_captcha");
logger.info("challengeResponse:"+challengeResponse);
boolean bRet = captchaService.validateResponseForID(captchaID, challengeResponse);
if( bRet )
return "home";
else
return "login";
} catch (CaptchaServiceException e) {
logger.error(e.getMessage(), e);
return "login";
}
}
public String check(ServletRequest theRequest, ServletResponse theResponse) {
HttpServletRequest request = (HttpServletRequest) theRequest;
HttpServletResponse response = (HttpServletResponse) theResponse;
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext());
CaptchaService captchaService = (CaptchaService) context.getBean("captchaService");
try {
String captchaID = request.getSession().getId();
logger.info("captchaID:"+captchaID);
String challengeResponse = request.getParameter("j_captcha");
logger.info("challengeResponse:"+challengeResponse);
boolean bRet = captchaService.validateResponseForID(captchaID, challengeResponse);
if( bRet )
return "home";
else
return "login";
} catch (CaptchaServiceException e) {
logger.error(e.getMessage(), e);
return "login";
}
}