乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      kaptcha一個很好用的驗證碼組件

       CevenCheng 2012-02-24
      官方網(wǎng)址:http://code.google.com/p/kaptcha 

      默認(rèn)配置即可滿足大部分用途。 
      <servlet> 
      <servlet-name>Kaptcha</servlet-name> 
      <servlet-class>com.google.code.kaptcha.servlet.KaptchaServlet</servlet-class> 
      </servlet> 
      <servlet-mapping> 
      <servlet-name>Kaptcha</servlet-name> 
      <url-pattern>/kaptcha</url-pattern> 
      </servlet-mapping> 

      <form action="submit.action"> 
      <img src="/kaptcha" /> 
      <input type="text" name="kaptcha" value="" /> 
      </form> 


      String kaptchaExpected = (String)request.getSession() .getAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY); 
      String kaptchaReceived = request.getParamater("kaptcha"); 
      if (kaptchaReceived == null || !kaptchaReceived.equalsIgnoreCase(kaptchaExpected)){ setError("kaptcha", "Invalid validation code.");} 



      可以通過實現(xiàn)一些里面的類。擴(kuò)展自己的需要。 

      實現(xiàn)TextProducer類可以設(shè)置自己想要的隨機(jī)數(shù)。 
      <init-param> 
      <param-name>kaptcha.textproducer.impl</param-name> 
      <param-value>springdemo.util.TextDemo</param-value> 
      </init-param> 
      <init-param> 
      <param-name>kaptcha.textproducer.font.names</param-name> 
      <param-value>新宋體</param-value> 
      </init-param> 

      詳細(xì)參數(shù)列表參見:http://code.google.com/p/kaptcha/wiki/ConfigParameters 

        本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約