第一步:在pom.xml中添加依赖 <!--验证码--> <!-- https://mvnrepository.com/artifact/com.github.penggle/kaptcha --> <dependency> <groupId>com.github.penggle</groupId> <artifactId>kaptcha</art
web.xml:配置kaptcha的servlet及部分样式模板 <servlet> <servlet-name>Kaptcha</servlet-name> <servlet-class>com.google.code.kaptcha.servlet.KaptchaServlet</servlet-class> <!-- 定义验证码样式 --> <!-- 是否有边
1.引入jar包 <dependency> <groupId>com.github.penggle</groupId> <artifactId>kaptcha</artifactId> <version>2.3.2</version> </dependency> 2.在web.xml中定义样式 <servlet> <servlet-name>