三部分内容
1、在登录页面生成验证码图片
2、点击图片更换新的验证码图片
3、点击登录,判定输入验证码与实际验证码是否一致
1、如何生成一个验证码图片,放置在登录页面?
servlet:
package com.zs.ssh.yzmServlet;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Random;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* Servlet implementation class yzmServlet
*/
@WebServlet("/yzmServlet")
public class yzmServlet extends HttpServ