Examples of TomahawkConfig


Examples of org.apache.myfaces.tomahawk.config.TomahawkConfig

                    .generateRandomColor(endingColor);

            // Generate random CAPTCHA text.
            captchaText = CAPTCHATextGenerator.generateRandomText();

            TomahawkConfig config = TomahawkConfig.getCurrentInstance(facesContext);
            // Set the generated text in the user session.
            facesContext.getExternalContext().getSessionMap().put(
                    config.isPrefixCaptchaSessionKey() ?
                    AbstractCAPTCHAComponent.ATTRIBUTE_CAPTCHA_SESSION_KEY_NAME+
                    "_"+captchaSessionKeyName : captchaSessionKeyName, captchaText);

            // Generate the image, the BG color is randomized from starting to ending colors.
            captchaImageGenerator.generateImage(response, captchaText,
View Full Code Here

Examples of org.apache.myfaces.tomahawk.config.TomahawkConfig

                            .generateRandomColor(endingColor);
               
                    // Generate random CAPTCHA text.
                    captchaText = CAPTCHATextGenerator.generateRandomText();

                    TomahawkConfig config = TomahawkConfig.getCurrentInstance(facesContext);
                    // Set the generated text in the user session.
                    facesContext.getExternalContext().getSessionMap().put(
                            config.isPrefixCaptchaSessionKey() ?
                                AbstractCAPTCHAComponent.ATTRIBUTE_CAPTCHA_SESSION_KEY_NAME+
                                    "_"+captchaSessionKeyName : captchaSessionKeyName, captchaText);

                    // Generate the image, the BG color is randomized from starting to ending colors.
                    captchaImageGenerator.generateImage(out, captchaText,
View Full Code Here

Examples of org.apache.myfaces.tomahawk.config.TomahawkConfig

     */
    public String getCaptchaSessionValue()
    {
        //Return the value stored
        ExternalContext externalContext = getFacesContext().getExternalContext();
        TomahawkConfig config = TomahawkConfig.getCurrentInstance(externalContext);
        if (externalContext.getSession(false) != null)
        {
            return (String) getFacesContext().getExternalContext().getSessionMap().get(
                    config.isPrefixCaptchaSessionKey() ?
                        ATTRIBUTE_CAPTCHA_SESSION_KEY_NAME+"_"+getCaptchaSessionKeyName() :
                        getCaptchaSessionKeyName());
        }
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.