for (Method method : handler.getClass().getDeclaredMethods()) {
if (methodId.equals(method.getName())) {
if (method.isAnnotationPresent(Captcha.class)) {
String key = method.getAnnotation(Captcha.class)
.value();
CapSecurityCaptcha captcha = CapAppContext
.getBean(CapCaptchaServlet.DEF_RENDERER);
if (captcha == null
|| !CaptchaStatus.SUCCESS.equals(captcha
.valid(params.get(key)))) {
// 驗証碼無效請重新輸入
throw new CapMessageException(
CapAppContext.getMessage(captcha.getErrorMessage()),
getClass());
}
}
}
}