- Create a Web project (there is no more to say here, since all started using SH, then I believe you have been using Java for some time)
- Download the jar package, here to provide my network disk, save everyone to find
hibernate3.6:Http://yunpan.cn/csdyPZvcbunad Access Password 0c53 spring3.2:Http://yunpan.cn/csdyME836dvYA Access Password 07C2
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);
}
From for notes (Wiz)
Annotated form: Spring3.2 MVC + Hibernate3.6 Integration (Basic)