1. 引入附件内JAR
2. 配置security.xml
<http auto-config="true">
........
<remember-me />
<custom-filter ref="captchaAuthenticationFilter" before="FORM_LOGIN_FILTER" />
</http>
<beans:bean id="captchaAuthenticationFilter"
class="org.springframework.security.captcha.JcaptchaAuthenticationFilter">
<beans:property name="imageCaptchaService" ref="imageCaptchaService" />
<beans:property name="authenticationFailureUrl" value="/login.action" />
</beans:bean>
3. login.html增加<input type='text' name='j_captcha'>
2. 配置security.xml
<http auto-config="true">
........
<remember-me />
<custom-filter ref="captchaAuthenticationFilter" before="FORM_LOGIN_FILTER" />
</http>
<beans:bean id="captchaAuthenticationFilter"
class="org.springframework.security.captcha.JcaptchaAuthenticationFilter">
<beans:property name="imageCaptchaService" ref="imageCaptchaService" />
<beans:property name="authenticationFailureUrl" value="/login.action" />
</beans:bean>
3. login.html增加<input type='text' name='j_captcha'>