今天無心間發現了一個很好用的驗證碼插件,java版的,很不錯的一個插件,只用簡單的在web.xml中設置幾個屬性,一個很漂亮的驗證碼就出來了。其餘的參數均可以本身設置,最牛的就是提供了接口,能夠本身定義哦。
先發個圖來看看:java
<init-param> <param-name>kaptcha.border</param-name> <param-value>yes</param-value> </init-param> <init-param> <param-name>kaptcha.border.color</param-name> <param-value>105,179,90</param-value> </init-param> <init-param> <param-name>kaptcha.textproducer.impl</param-name> <param-value>com.randcode.ChineseText</param-value> </init-param> <init-param> <param-name>kaptcha.textproducer.font.color</param-name> <param-value>black</param-value> </init-param> <init-param> <param-name>kaptcha.image.width</param-name> <param-value>500</param-value> </init-param> <init-param> <param-name>kaptcha.image.height</param-name> <param-value>300</param-value> </init-param> <init-param> <param-name>kaptcha.textproducer.font.size</param-name> <param-value>90</param-value> </init-param> <init-param> <param-name>kaptcha.session.key</param-name> <param-value>code</param-value> </init-param> <init-param> <param-name>kaptcha.textproducer.char.length</param-name> <param-value>4</param-value> </init-param> <init-param> <param-name>kaptcha.textproducer.font.names</param-name> <param-value>宋體,楷體,微軟雅黑</param-value> </init-param>
<init-param> <param-name>kaptcha.textproducer.impl</param-name> <param-value>com.randcode.ChineseText</param-value> </init-param>