Class Captcha

java.lang.Object
sk.iway.iwcm.system.captcha.Captcha

public class Captcha extends Object
Captcha.java
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    getImage(javax.servlet.http.HttpServletRequest request)
    Vrati HTML kod captcha obrazku
    static void
    getImage(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
    Vygeneruje JPG obrazok captchy
    static boolean
    isReponseCorrect(javax.servlet.http.HttpServletRequest httpServletRequest, String response)
    Overi spravnost odpovede voci obrazku, pouziva sa opakovane cez AJAX volanie (viz check_form_impl.jsp) NEPOUZIVAT V JAVA KODE NA OVERENIE SPRAVNOSTI CAPTCHA, na to treba pouzit validateResponse!!!!
    static boolean
    isRequired(String component)
    Vrati true ak je pre zadanu komponentu vyzadovana captcha (nastavuje sa konfiguracnou premennou captchaComponents ako zoznam oddeleny medzerami)
    static boolean
    validateResponse(javax.servlet.http.HttpServletRequest httpServletRequest, String response, String component)
    Zvaliduje a VYMAZE odpoved (malo by sa pouzit vo finalnej validacii na strane servera)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Captcha

      public Captcha()
  • Method Details

    • isRequired

      public static boolean isRequired(String component)
      Vrati true ak je pre zadanu komponentu vyzadovana captcha (nastavuje sa konfiguracnou premennou captchaComponents ako zoznam oddeleny medzerami)
      Parameters:
      component -
      Returns:
    • validateResponse

      public static boolean validateResponse(javax.servlet.http.HttpServletRequest httpServletRequest, String response, String component)
      Zvaliduje a VYMAZE odpoved (malo by sa pouzit vo finalnej validacii na strane servera)
      Parameters:
      httpServletRequest -
      response -
      component - - meno komponenty, alebo null ak kontrolu na povolenie komponenty nie je potrebne vykonat
      Returns:
    • isReponseCorrect

      public static boolean isReponseCorrect(javax.servlet.http.HttpServletRequest httpServletRequest, String response)
      Overi spravnost odpovede voci obrazku, pouziva sa opakovane cez AJAX volanie (viz check_form_impl.jsp) NEPOUZIVAT V JAVA KODE NA OVERENIE SPRAVNOSTI CAPTCHA, na to treba pouzit validateResponse!!!!
      Parameters:
      httpServletRequest -
      response -
      Returns:
    • getImage

      public static void getImage(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws javax.servlet.ServletException, IOException
      Vygeneruje JPG obrazok captchy
      Parameters:
      httpServletRequest -
      httpServletResponse -
      Throws:
      javax.servlet.ServletException
      IOException
    • getImage

      public static String getImage(javax.servlet.http.HttpServletRequest request)
      Vrati HTML kod captcha obrazku
      Parameters:
      request -
      Returns: