- Kaptcha
1. 为什么需要验证码
2. kaptcha如何使用:
- 添加jar
- 在web.xml文件中注册KaptchaServlet,并设置验证码图片的相关属性
- 在html页面上编写一个img标签,然后设置src等于KaptchaServlet对应的url-pattern
3. kaptcha验证码图片的各个属性在常量接口:Constants中
4. KaptchaServlet在生成验证码图片时,会同时将验证码信息保存到session中
因此,我们在注册请求时,首先将用户文本框中输入的验证码值和session中保存的值进行比较,相等,则进行注册
