/** * Iterate over dynamically added Tiles attributes (see "Runtime Composition" * in the Tiles documentation) and add them to the output Map passed as input. * * @param container the Tiles container * @param tilesRequest the Tiles request * @param resultMap the output Map where attributes of interest are added to. */ protected void addRuntimeAttributes(BasicTilesContainer container, Request tilesRequest, Map<String, Attribute> resultMap) { AttributeContext attributeContext = container.getAttributeContext(tilesRequest); Set<String> attributeNames = new HashSet<>(); if (attributeContext.getLocalAttributeNames() != null) { attributeNames.addAll(attributeContext.getLocalAttributeNames()); } if (attributeContext.getCascadedAttributeNames() != null) { attributeNames.addAll(attributeContext.getCascadedAttributeNames()); } for (String name : attributeNames) { Attribute attr = attributeContext.getAttribute(name); resultMap.put(name, attr); } } }
/** {@inheritDoc} */ public void inheritCascadedAttributes(AttributeContext context) { if (context instanceof BasicAttributeContext) { copyCascadedAttributes((BasicAttributeContext) context); } else { this.cascadedAttributes = new HashMap<String, Attribute>(); for (String name : context.getCascadedAttributeNames()) { cascadedAttributes.put(name, new Attribute(context .getCascadedAttribute(name))); } } }
/** * Iterate over dynamically added Tiles attributes (see "Runtime Composition" * in the Tiles documentation) and add them to the output Map passed as input. * * @param container the Tiles container * @param tilesRequest the Tiles request * @param resultMap the output Map where attributes of interest are added to. */ protected void addRuntimeAttributes(BasicTilesContainer container, Request tilesRequest, Map<String, Attribute> resultMap) { AttributeContext attributeContext = container.getAttributeContext(tilesRequest); Set<String> attributeNames = new HashSet<>(); if (attributeContext.getLocalAttributeNames() != null) { attributeNames.addAll(attributeContext.getLocalAttributeNames()); } if (attributeContext.getCascadedAttributeNames() != null) { attributeNames.addAll(attributeContext.getCascadedAttributeNames()); } for (String name : attributeNames) { Attribute attr = attributeContext.getAttribute(name); resultMap.put(name, attr); } } }
/** {@inheritDoc} */ public void inheritCascadedAttributes(AttributeContext context) { if (context instanceof BasicAttributeContext) { copyCascadedAttributes((BasicAttributeContext) context); } else { this.cascadedAttributes = new HashMap<String, Attribute>(); Set<String> parentAttributeNames = context.getCascadedAttributeNames(); if (parentAttributeNames != null) { for (String name : parentAttributeNames) { cascadedAttributes.put(name, new Attribute(context .getCascadedAttribute(name))); } } } }
attributeNames.addAll(attributeContext.getLocalAttributeNames()); if (attributeContext.getCascadedAttributeNames() != null) { attributeNames.addAll(attributeContext.getCascadedAttributeNames());
/** * <p> * Iterate over dynamically added Tiles attributes (see "Runtime Composition" in the Tiles documentation) and add * them to the output Map passed as input. * </p> * * @param container the Tiles container * @param resultMap the output Map where attributes of interest are added to. * @param request the Servlet request * @param response the Servlet response */ protected void addRuntimeAttributes(BasicTilesContainer container, Map<String, Attribute> resultMap, HttpServletRequest request, HttpServletResponse response) { AttributeContext attributeContext = container.getAttributeContext(new Object[] { request, response }); Set<String> attributeNames = new HashSet<String>(); if (attributeContext.getLocalAttributeNames() != null) { attributeNames.addAll(attributeContext.getLocalAttributeNames()); } if (attributeContext.getCascadedAttributeNames() != null) { attributeNames.addAll(attributeContext.getCascadedAttributeNames()); } for (String name : attributeNames) { Attribute attr = attributeContext.getAttribute(name); resultMap.put(name, attr); } } }
/** * Iterate over dynamically added Tiles attributes (see "Runtime Composition" * in the Tiles documentation) and add them to the output Map passed as input. * * @param container the Tiles container * @param tilesRequest the Tiles request * @param resultMap the output Map where attributes of interest are added to. */ protected void addRuntimeAttributes(BasicTilesContainer container, Request tilesRequest, Map<String, Attribute> resultMap) { AttributeContext attributeContext = container.getAttributeContext(tilesRequest); Set<String> attributeNames = new HashSet<String>(); if (attributeContext.getLocalAttributeNames() != null) { attributeNames.addAll(attributeContext.getLocalAttributeNames()); } if (attributeContext.getCascadedAttributeNames() != null) { attributeNames.addAll(attributeContext.getCascadedAttributeNames()); } for (String name : attributeNames) { Attribute attr = attributeContext.getAttribute(name); resultMap.put(name, attr); } } }
attributeNames.addAll(attributeContext.getLocalAttributeNames()); if (attributeContext.getCascadedAttributeNames() != null) { attributeNames.addAll(attributeContext.getCascadedAttributeNames());
attributeNames.addAll(attributeContext.getLocalAttributeNames()); if (attributeContext.getCascadedAttributeNames() != null) { attributeNames.addAll(attributeContext.getCascadedAttributeNames());
/** * Expose the requested property from attribute context. * * @throws TilesJspException On errors processing tag. */ public void execute() throws TilesJspException { if (attributeValue != null) { pageContext.setAttribute(toName != null ? toName : name, attributeValue, scope); } else { importAttributes(attributeContext.getCascadedAttributeNames()); importAttributes(attributeContext.getLocalAttributeNames()); } }
ignore, retValue, request); } else { importAttributes(attributeContext.getCascadedAttributeNames(), container, attributeContext, retValue, ignore, request); importAttributes(attributeContext.getLocalAttributeNames(),
Set<String> names = parent.getCascadedAttributeNames(); if (names != null && !names.isEmpty()) { for (String name : names) {
Set<String> names = parent.getCascadedAttributeNames(); if (names != null && !names.isEmpty()) { for (String name : names) {