Examples of AttributeContext


Examples of org.apache.tiles.AttributeContext

     *
     * @param tilesContext The request context to use.
     * @return The newly created attribute context.
     */
    private AttributeContext startContext(TilesRequestContext tilesContext) {
        AttributeContext context = new BasicAttributeContext();
        Stack<AttributeContext>  stack = getContextStack(tilesContext);
        if (!stack.isEmpty()) {
            AttributeContext parent = stack.peek();
            context.inheritCascadedAttributes(parent);
        }
        stack.push(context);
        return context;
    }
View Full Code Here

Examples of org.apache.tiles.AttributeContext

        if (preparer == null) {
            throw new NoSuchPreparerException("Preparer '" + preparerName + " not found");
        }

        AttributeContext attributeContext = getContext(context);

        preparer.execute(context, attributeContext);
    }
View Full Code Here

Examples of org.apache.tiles.AttributeContext

                LOG.warn(message);
            }
            throw new NoSuchDefinitionException(definitionName);
        }

        AttributeContext originalContext = getAttributeContext(request);
        BasicAttributeContext subContext = new BasicAttributeContext(originalContext);
        subContext.inherit(definition);

        if (!isPermitted(request, subContext.getRoles())) {
            if (LOG.isDebugEnabled()) {
View Full Code Here

Examples of org.apache.tiles.AttributeContext

        RequestDispatcher rd = EasyMock.createMock(RequestDispatcher.class);
        TilesApplicationContext applicationContext = new ServletTilesApplicationContext(
                servletContext);
        TilesRequestContext requestContext = new ServletTilesRequestContext(
                applicationContext, request, response);
        AttributeContext attributeContext = EasyMock
                .createMock(AttributeContext.class);

        EasyMock.expect(request.getRequestDispatcher("/my/url.do"))
                .andReturn(rd);
        rd.include(request, response);
View Full Code Here

Examples of org.apache.tiles.AttributeContext

    }

    /** {@inheritDoc} */
    public void renderContext(Object... requestItems) {
        TilesRequestContext request = getRequestContext(requestItems);
        AttributeContext attributeContext = getAttributeContext(request);

        render(request, attributeContext);
    }
View Full Code Here

Examples of org.apache.tiles.AttributeContext

     *
     * @param tilesContext The request context to use.
     * @return The current attribute context.
     */
    private AttributeContext getAttributeContext(TilesRequestContext tilesContext) {
        AttributeContext context = getContext(tilesContext);
        if (context == null) {
            context = new BasicAttributeContext();
            pushContext(context, tilesContext);
        }
        return context;
View Full Code Here

Examples of org.apache.tiles.AttributeContext

     *
     * @param tilesContext The request context to use.
     * @return The newly created attribute context.
     */
    private AttributeContext startContext(TilesRequestContext tilesContext) {
        AttributeContext context = new BasicAttributeContext();
        Stack<AttributeContext>  stack = getContextStack(tilesContext);
        if (!stack.isEmpty()) {
            AttributeContext parent = stack.peek();
            context.inheritCascadedAttributes(parent);
        }
        stack.push(context);
        return context;
    }
View Full Code Here

Examples of org.apache.tiles.AttributeContext

        if (preparer == null) {
            throw new NoSuchPreparerException("Preparer '" + preparerName + " not found");
        }

        AttributeContext attributeContext = getContext(context);

        preparer.execute(context, attributeContext);
    }
View Full Code Here

Examples of org.apache.tiles.AttributeContext

                log.warn(message);
            }
            throw new NoSuchDefinitionException(definitionName);
        }

        AttributeContext originalContext = getAttributeContext(request);
        BasicAttributeContext subContext = new BasicAttributeContext(originalContext);
        subContext.inherit(definition);

        pushContext(subContext, request);
View Full Code Here

Examples of org.apache.tiles.AttributeContext

    private void renderDefinition(TilesContainer container,
            String definitionName, String template, String templateType,
            String templateExpression, String role, String preparer,
            boolean flush, Request request) throws IOException {
        try {
            AttributeContext attributeContext = container
                    .getAttributeContext(request);
            Attribute templateAttribute = Attribute.createTemplateAttribute(template,
                    templateExpression, templateType, role);
            attributeContext.setPreparer(preparer);
            attributeContext.setTemplateAttribute(templateAttribute);
            container.render(definitionName, request);
            if (flush) {
                request.getWriter().flush();
            }
        } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.