Example usage for com.liferay.portal.kernel.util WebKeys CAPTCHA_TEXT

List of usage examples for com.liferay.portal.kernel.util WebKeys CAPTCHA_TEXT

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util WebKeys CAPTCHA_TEXT.

Prototype

String CAPTCHA_TEXT

To view the source code for com.liferay.portal.kernel.util WebKeys CAPTCHA_TEXT.

Click Source Link

Usage

From source file:com.liferay.faces.bridge.demos.validation.CaptchaTestValidatorBean.java

License:Open Source License

public String getCorrectCaptchaValue() {

    if (correctCaptchaValue == null) {

        FacesContext facesContext = FacesContext.getCurrentInstance();
        ExternalContext externalContext = facesContext.getExternalContext();
        Map<String, Object> sessionMap = externalContext.getSessionMap();
        correctCaptchaValue = (String) sessionMap.get(WebKeys.CAPTCHA_TEXT);

        if (correctCaptchaValue == null) {
            return "Correct Captcha Value";
        }/*from   w  ww . j  av a2 s  .c  o  m*/
    }

    return correctCaptchaValue;
}