@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { FacesContext facesContext = FacesContext.getCurrentInstance(); Class<?> type = getClassFromAttribute(typeTagAttribute, ctx); Map<String, Object> constants = getConstants(facesContext, type); // Create alias/var expression String var; if (varTagAttribute == null) { var = type.getSimpleName(); // fall back to class name } else { var = varTagAttribute.getValue(ctx); } ctx.setAttribute(var, constants); }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { FacesContext facesContext = FacesContext.getCurrentInstance(); Class<?> type = getClassFromAttribute(typeTagAttribute, ctx); Map<String, Object> enumValues = getEnumValues(facesContext, type, allSuffixTagAttribute == null ? null : allSuffixTagAttribute.getValue(ctx)); // Create alias/var expression String var; if (varTagAttribute == null) { var = type.getSimpleName(); // fall back to class name } else { var = varTagAttribute.getValue(ctx); } ctx.setAttribute(var, enumValues); }
private static Deque<Set<String>> _getStackOfTrackedIds(FaceletContext ctx) { Deque<Set<String>> stack = (Deque<Set<String>>)ctx.getAttribute(_STACK_OF_TRACKED_IDS); if (stack == null) { stack = new LinkedList<Set<String>>(); ctx.setAttribute(_STACK_OF_TRACKED_IDS, stack); } return stack; }
private static Deque<Set<String>> _getStackOfTrackedIds(FaceletContext ctx) { Deque<Set<String>> stack = (Deque<Set<String>>)ctx.getAttribute(_STACK_OF_TRACKED_IDS); if (stack == null) { stack = new LinkedList<>(); ctx.setAttribute(_STACK_OF_TRACKED_IDS, stack); } return stack; }
private static Deque<Set<String>> _getStackOfTrackedIds(FaceletContext ctx) { Deque<Set<String>> stack = (Deque<Set<String>>)ctx.getAttribute(_STACK_OF_TRACKED_IDS); if (stack == null) { stack = new LinkedList<>(); ctx.setAttribute(_STACK_OF_TRACKED_IDS, stack); } return stack; }
/** * @see Faces#setFaceletAttribute(String, Object) */ public static void setFaceletAttribute(FacesContext context, String name, Object value) { getFaceletContext(context).setAttribute(name, value); }
/** * @see Faces#setFaceletAttribute(String, Object) */ public static void setFaceletAttribute(FacesContext context, String name, Object value) { getFaceletContext(context).setAttribute(name, value); }
private static Deque<Set<String>> _getStackOfTrackedIds(FaceletContext ctx) { Deque<Set<String>> stack = (Deque<Set<String>>)ctx.getAttribute(_STACK_OF_TRACKED_IDS); if (stack == null) { stack = new LinkedList<>(); ctx.setAttribute(_STACK_OF_TRACKED_IDS, stack); } return stack; }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { try { this.nextHandler.apply(ctx, parent); } catch (Exception e) { if (this.var != null) { ctx.setAttribute(this.var.getValue(ctx), e); } } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { try { this.nextHandler.apply(ctx, parent); } catch (Exception e) { if (this.var != null) { ctx.setAttribute(this.var.getValue(ctx), e); } } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { try { this.nextHandler.apply(ctx, parent); } catch (Exception e) { if (this.var != null) { ctx.setAttribute(this.var.getValue(ctx), e); } } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { try { this.nextHandler.apply(ctx, parent); } catch (Exception e) { if (this.var != null) { ctx.setAttribute(this.var.getValue(ctx), e); } } }
@Override public void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent) { String applySelId = selectedIdTag.getValue(ctx); String key= SELECTED_ID_KEY+c.getClientId(); if (applySelId!=null && applySelId.trim().length()>0){ // logger.info(" applynext handler has id="+applySelId); c.getAttributes().put(key, applySelId); c.getAttributes().put("parentId", c.getId()); ctx.setAttribute(key,applySelId); //setSelectedId(ctx, c, applySelId); } else { logger.finer("PROBLEM>.... selectedId null but still apply next handler-> get from attribute map...") ; // logger.info(" namingContainer ID="+c.getContainerClientId(facesContext)); } }
@Override public void apply(FaceletContext faceletContext, UIComponent parent) throws IOException { if (SecurityContextHolder.getContext().getAuthentication() == null) { return; } AuthorizeFaceletsTag authorizeTag = new AuthorizeFaceletsTag(faceletContext, this.access, this.url, this.method, this.ifAllGranted, this.ifAnyGranted, this.ifNotGranted); boolean isAuthorized = authorizeTag.authorize(); if (isAuthorized) { this.nextHandler.apply(faceletContext, parent); } if (this.var != null) { faceletContext.setAttribute(this.var.getValue(faceletContext), Boolean.valueOf(isAuthorized)); } }
@Override public void apply(FaceletContext faceletContext, UIComponent parent) throws IOException { if (SecurityContextHolder.getContext().getAuthentication() == null) { return; } AuthorizeFaceletsTag authorizeTag = new AuthorizeFaceletsTag(faceletContext, this.access, this.url, this.method, this.ifAllGranted, this.ifAnyGranted, this.ifNotGranted); boolean isAuthorized = authorizeTag.authorize(); if (isAuthorized) { this.nextHandler.apply(faceletContext, parent); } if (this.var != null) { faceletContext.setAttribute(this.var.getValue(faceletContext), Boolean.valueOf(isAuthorized)); } }
@Override public void apply(FaceletContext faceletContext, UIComponent parent) throws IOException { if (SecurityContextHolder.getContext().getAuthentication() == null) { return; } AuthorizeFaceletsTag authorizeTag = new AuthorizeFaceletsTag(faceletContext, this.access, this.url, this.method, this.ifAllGranted, this.ifAnyGranted, this.ifNotGranted); boolean isAuthorized = authorizeTag.authorize(); if (isAuthorized) { this.nextHandler.apply(faceletContext, parent); } if (this.var != null) { faceletContext.setAttribute(this.var.getValue(faceletContext), isAuthorized); } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, ELException { boolean b = this.test.getBoolean(ctx); if (this.var != null) { ctx.setAttribute(var.getValue(ctx), b); } if (b) { this.nextHandler.apply(ctx, parent); } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, ELException { boolean b = this.test.getBoolean(ctx); if (this.var != null) { ctx.setAttribute(var.getValue(ctx), b); } if (b) { this.nextHandler.apply(ctx, parent); } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, ELException { boolean b = this.test.getBoolean(ctx); if (this.var != null) { ctx.setAttribute(var.getValue(ctx), b); } if (b) { this.nextHandler.apply(ctx, parent); } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, ELException { boolean b = this.test.getBoolean(ctx); if (this.var != null) { ctx.setAttribute(var.getValue(ctx), b); } if (b) { this.nextHandler.apply(ctx, parent); } }