标签:style blog http io os ar 使用 java sp
public void regCode(HttpServletRequest request,
HttpServletResponse response) throws IOException {
// 配置头文件属性
confBaseHeader(response);
// 生产验证码信息
String captchaText = CaptchaProducer.createText();
BufferedImage captchaImage = CaptchaProducer.createImage(captchaText);
OutputStream os = response.getOutputStream();
request.getSession().setAttribute("regCode", captchaText);
ImageIO.write(captchaImage, IMAGE_TYPE, os);
closeStream(os);
}
注解形式:Spring3.2 MVC + Hibernate3.6 集成 (基础篇)
标签:style blog http io os ar 使用 java sp
原文地址:http://www.cnblogs.com/xiaojianyu/p/4045393.html