预览加载中,请您耐心等待几秒...
1/6
2/6
3/6
4/6
5/6
6/6

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

用之前要导入patchcajar包,可能会与tomcat的lib目录下的jar包发生冲突,一切准备好之后在使用下面的代码(导入jar包后,先发布其他的项目试试,没问题的发继续) packagecom.ninemax.cul.servlet; importjava.awt.Color; importjava.awt.Graphics; importjava.awt.image.BufferedImage; importjava.awt.image.BufferedImageOp; importjava.io.IOException; importjava.io.OutputStream; importjava.util.ArrayList; importjava.util.List; importjava.util.Random; importjavax.imageio.ImageIO; importjavax.servlet.ServletException; importjavax.servlet.http.HttpServlet; importjavax.servlet.http.HttpServletRequest; importjavax.servlet.http.HttpServletResponse; importjavax.servlet.http.HttpSession; importorg.patchca.background.BackgroundFactory; importorg.patchca.color.ColorFactory; importorg.patchca.color.RandomColorFactory; importorg.patchca.filter.ConfigurableFilterFactory; importorg.patchca.filter.library.AbstractImageOp; importorg.patchca.filter.library.WobbleImageOp; importorg.patchca.font.RandomFontFactory; importorg.patchca.service.Captcha; importorg.patchca.service.ConfigurableCaptchaService; importorg.patchca.text.renderer.BestFitTextRenderer; importorg.patchca.text.renderer.TextRenderer; importorg.patchca.word.RandomWordFactory; /** *验证码生成类 * *使用开源验证码项目patchca生成 *依赖jar包:patchca-0.5.0.jar *项目网址:https://code.google.com/p/patchca/ * *@authorzyh *@version1.002012-7-12New */ publicclassValidationCodeServletextendsHttpServlet{ privatestaticfinallongserialVersionUID=5126616339795936447L; privateConfigurableCaptchaServiceconfigurableCaptchaService=null; privateColorFactorycolorFactory=null; privateRandomFontFactoryfontFactory=null; privateRandomWordFactorywordFactory=null; privateTextRenderertextRenderer=null; publicValidationCodeServlet(){ super(); } /** *Servlet销毁方法,负责销毁所使用资源.<br> */ publicvoiddestroy(){ wordFactory=null; colorFactory=null; fontFactory=null; textRenderer=null; configurableCaptchaService=null; super.destroy();//Justputs"destroy"stringinlog } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponserespon