Package org.apache.tiles

Examples of org.apache.tiles.ComponentAttribute


     * @param beanName    Name of the bean to find.
     * @param pageContext Page context.
     * @return Requested bean or <code>null</code> if not found.
     */
    public ComponentAttribute findAttribute(String beanName, PageContext pageContext) {
        ComponentAttribute attribute = getAttribute(beanName);
        if (attribute == null) {
            Object attributeValue = pageContext.findAttribute(beanName);
            attribute = new ComponentAttribute(attributeValue);
        }

        return attribute;
    }
View Full Code Here


        }

        Object attributeValue =
            pageContext.getAttribute(beanName, scope);
        if(attributeValue != null) {
            return new ComponentAttribute(attributeValue);
        }

        return null;
    }
View Full Code Here

     * the appropriate security.
     *
     * @param nestedTag the put tag desciendent.
     */
    public void processNestedTag(AddAttributeTag nestedTag) {
        ComponentAttribute attribute = new ComponentAttribute(
            nestedTag.getValue(), nestedTag.getRole(),
            nestedTag.getType());

        this.addValue(attribute)
    }
View Full Code Here

     * the appropriate security.
     *
     * @param nestedTag the put tag desciendent.
     */
    public void processNestedTag(AddAttributeTag nestedTag) {
        ComponentAttribute attribute = new ComponentAttribute(
            nestedTag.getValue(), nestedTag.getRole(),
            nestedTag.getType());

        this.addValue(attribute)
    }
View Full Code Here

     */
    protected void overload(ComponentDefinition parent,
                            ComponentDefinition child) {
        // Iterate on each parent's attribute and add it if not defined in child.
        for(Map.Entry<String, ComponentAttribute> entry : parent.getAttributes().entrySet()) {
            child.putAttribute(entry.getKey(), new ComponentAttribute(entry.getValue()));
        }

        if (child.getTemplate() == null)
            child.setTemplate(parent.getTemplate());

View Full Code Here

        this.name = null;
        this.value = null;
    }

    protected void render() throws JspException, TilesException, IOException {
        ComponentAttribute attr = (ComponentAttribute) value;
        if (attr == null && evaluatingContext != null) {
            attr = evaluatingContext.getAttribute(name);
        }
        if (attr == null && ignore) {
            return;
View Full Code Here

     *
     * @param key name of the attribute
     * @return requested attribute or null if not found
     */
    public Object getAttribute(String key) {
        ComponentAttribute attribute = attributes.get(key);
        if (attribute != null) {
            return attribute.getValue();
        } else {
            return null;
        }
    }
View Full Code Here

        return ((HttpServletRequest) request).getServletPath();
    }

    class DefaultMutator implements ComponentContextMutator {
        public void mutate(ComponentContext ctx, ServletRequest req) {
            ComponentAttribute attr = new ComponentAttribute();
            attr.setType(ComponentAttribute.TEMPLATE);
            attr.setName(componentAttributeName);
            attr.setValue(getRequestBase(req));
            ctx.putAttribute(componentAttributeName, attr);
        }
View Full Code Here

TOP

Related Classes of org.apache.tiles.ComponentAttribute

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.