Package sk.iway.iwcm.system.captcha
Class Captcha
java.lang.Object
sk.iway.iwcm.system.captcha.Captcha
Captcha.java
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getImage
(javax.servlet.http.HttpServletRequest request) Vrati HTML kod captcha obrazkustatic void
getImage
(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) Vygeneruje JPG obrazok captchystatic 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)
-
Constructor Details
-
Captcha
public Captcha()
-
-
Method Details
-
isRequired
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
Vrati HTML kod captcha obrazku- Parameters:
request
-- Returns:
-