Package org.apache.shale.util

Examples of org.apache.shale.util.TokenProcessor


        super.validate(context);
        String token = (String) getValue();
        if (log.isDebugEnabled()) {
            log.debug("Validating token '" + token + "'");
        }
        TokenProcessor tp = getTokenProcessor(context);
        if (!tp.verify(context, token)) {
            if (log.isDebugEnabled()) {
                log.debug("  Validation failed!");
            }
            setValid(false);
            String summary = getErrorSummaryMessage(context);
View Full Code Here


        }

        // Generate a new token value and cache it for reuse if the
        // current view is rerendered
        FacesContext context = FacesContext.getCurrentInstance();
        TokenProcessor tp = getTokenProcessor(context);
        String token = tp.generate(context);
        getAttributes().put(TOKEN_ATTRIBUTE_KEY, token);
        if (log.isDebugEnabled()) {
            log.debug("Generating token '" + token + "'");
        }
        return token;
View Full Code Here

     *
     * @param context <code>FacesContext</code> for the current request
     */
     private TokenProcessor getTokenProcessor(FacesContext context) {

         TokenProcessor tp = (TokenProcessor) context.getExternalContext().
           getApplicationMap().get(ShaleConstants.TOKEN_PROCESSOR);
         if (tp == null) {
             tp = new TokenProcessor();
             context.getExternalContext().
               getApplicationMap().put(ShaleConstants.TOKEN_PROCESSOR, tp);
         }
         return tp;

View Full Code Here

TOP

Related Classes of org.apache.shale.util.TokenProcessor

Copyright © 2018 www.massapicom. 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.