/** * This fires during the Restore View phase, restoring state. */ public static final Object reconstruct(String string, ExternalContext ctx) { byte[] bytes; try { if(log.isLoggable(Level.FINE)) log.fine("Processing state : "+string); bytes = string.getBytes(ZIP_CHARSET); bytes = decode(bytes); if(isSecure(ctx)) bytes = decrypt(bytes, ctx); if( enableCompression(ctx) ) bytes = decompress(bytes); return getAsObject(bytes, ctx); } catch (Throwable e) { if (log.isLoggable(Level.SEVERE)) { log.log(Level.SEVERE, "View State cannot be reconstructed", e); } return null; } }
/** * This fires during the Restore View phase, restoring state. */ public static final Object reconstruct(String string, ExternalContext ctx) { byte[] bytes; try { if(log.isLoggable(Level.FINE)) log.fine("Processing state : "+string); bytes = string.getBytes(ZIP_CHARSET); bytes = decode(bytes); if(isSecure(ctx)) bytes = decrypt(bytes, ctx); if( enableCompression(ctx) ) bytes = decompress(bytes); return getAsObject(bytes, ctx); } catch (Throwable e) { if (log.isLoggable(Level.SEVERE)) { log.log(Level.SEVERE, "View State cannot be reconstructed", e); } return null; } }
/** * This fires during the Render Response phase, saving state. */ public static final String construct(Object object, ExternalContext ctx){ byte[] bytes = getAsByteArray(object, ctx); if( enableCompression(ctx) ) bytes = compress(bytes); if(isSecure(ctx)) bytes = encrypt(bytes, ctx); bytes = encode(bytes); try { return new String(bytes, ZIP_CHARSET); } catch (UnsupportedEncodingException e) { throw new FacesException(e); } }
/** * This fires during the Render Response phase, saving state. */ public static final String construct(Object object, ExternalContext ctx){ byte[] bytes = getAsByteArray(object, ctx); if( enableCompression(ctx) ) bytes = compress(bytes); if(isSecure(ctx)) bytes = encrypt(bytes, ctx); bytes = encode(bytes); try { return new String(bytes, ZIP_CHARSET); } catch (UnsupportedEncodingException e) { throw new FacesException(e); } }
/** * This fires during the Render Response phase, saving state. */ public static final String construct(Object object, ExternalContext ctx){ byte[] bytes = getAsByteArray(object, ctx); if( enableCompression(ctx) ) bytes = compress(bytes); if(isSecure(ctx)) bytes = encrypt(bytes, ctx); bytes = encode(bytes); try { return new String(bytes, ZIP_CHARSET); } catch (UnsupportedEncodingException e) { throw new FacesException(e); } }
/** * This fires during the Restore View phase, restoring state. */ public static final Object reconstruct(String string, ExternalContext ctx){ byte[] bytes; try { bytes = string.getBytes(ZIP_CHARSET); bytes = decode(bytes); if(isSecure(ctx)) bytes = decrypt(bytes, ctx); if( enableCompression(ctx) ) bytes = decompress(bytes); return getAsObject(bytes, ctx); } catch (UnsupportedEncodingException e) { throw new FacesException(e); } }