wordrenderercontroller.groovy

来自「一个为 Java/J2EE生成的最简化CAPTCHA的框架」· GROOVY 代码 · 共 24 行

GROOVY
24
字号
import nl.captcha.Captchaimport nl.captcha.text.renderer.*import nl.captcha.servlet.CaptchaServletUtilclass WordRendererController {    def final WIDTH = 200    def final HEIGHT = 50    def simple = {        def captcha = new Captcha.Builder(WIDTH, HEIGHT)            .addText()            .build()        CaptchaServletUtil.writeImage(response, captcha.image)    }    def simple2 = {        def captcha = new Captcha.Builder(WIDTH, HEIGHT)            .addText(new ColoredEdgesWordRenderer())            .build()        CaptchaServletUtil.writeImage(response, captcha.image)    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?