Package org.apache.tiles

Examples of org.apache.tiles.TilesContainer.render()


                .createMock(TilesRequestContext.class);
        Object[] requestObjects = new Object[0];
        EasyMock.expect(requestContext.getRequestObjects()).andReturn(requestObjects);
        EasyMock.expect(contextFactory.createRequestContext(applicationContext))
                .andReturn(requestContext);
        container.render("my.definition");
        EasyMock.replay(applicationContext, contextFactory, requestContext,
                container);
        renderer.setApplicationContext(applicationContext);
        renderer.setRequestContextFactory(contextFactory);
        renderer.setContainer(container);
View Full Code Here


                .andReturn(requestContext);
        Object[] requestObjects = new Object[0];
        EasyMock.expect(requestContext.getRequestObjects()).andReturn(requestObjects);
        EasyMock.expect(container.isValidDefinition("my.definition"))
                .andReturn(Boolean.TRUE);
        container.render("my.definition");
        EasyMock.replay(applicationContext, contextFactory, requestContext,
                container);
        renderer.setApplicationContext(applicationContext);
        renderer.setRequestContextFactory(contextFactory);
        renderer.setContainer(container);
View Full Code Here

        try {
            if(preventDecorationToken != null) {
                req.setAttribute(preventDecorationToken, Boolean.TRUE);
            }
            String definitionName = getDefinitionForRequest(req);
            container.render(definitionName, req, res);
        }
        catch (TilesException e) {
            throw new ServletException("Error wrapping jsp with tile definition. "
                            + e.getMessage(), e);
        }
View Full Code Here

        try {
            String definition = getDefinitionName(req);
            if (LOG.isDebugEnabled()) {
                LOG.info("Dispatching to tile '" + definition + "'");
            }
            container.render(definition, req, res);
        } catch (TilesException e) {
            throw new ServletException("Error rendering tile.", e);
        }
    }
View Full Code Here

        expect(request.getAttribute(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(container);
        expect(applicationContext.getApplicationScope()).andReturn(applicationScope).anyTimes();
        expect(servletContext.getAttribute(ApplicationAccess
                .APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(applicationContext)
                .anyTimes();
        container.render(eq(attribute), isA(VelocityRequest.class));

        replay(velocityContext, request, response, servletContext, container,
                internalContextAdapter, applicationContext);
        initializeTool();
        Renderable renderable = tool.render(attribute);
View Full Code Here

        expect(request.getAttribute(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(container);
        expect(applicationContext.getApplicationScope()).andReturn(applicationScope).anyTimes();
        expect(servletContext.getAttribute(ApplicationAccess
                .APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(applicationContext)
                .anyTimes();
        container.render(eq("myDefinition"), isA(VelocityRequest.class));

        replay(velocityContext, request, response, servletContext, container,
                internalContextAdapter, applicationContext);
        initializeTool();
        Renderable renderable = tool.renderDefinition("myDefinition");
View Full Code Here

                    throws IOException {
                Request velocityRequest = createVelocityRequest(
                        getServletContext(), writer);
                TilesContainer container = TilesAccess
                        .getCurrentContainer(velocityRequest);
                container.render(attribute, velocityRequest);
                return true;
            }

        };
    }
View Full Code Here

            public boolean render(InternalContextAdapter context, Writer writer) {
                Request velocityRequest = createVelocityRequest(
                        getServletContext(), writer);
                TilesContainer container = TilesAccess
                        .getCurrentContainer(velocityRequest);
                container.render(definitionName, velocityRequest);
                return true;
            }

        };
    }
View Full Code Here

        expect(container.startContext(request)).andReturn(attributeContext);
        expect(container.getAttributeContext(request)).andReturn(attributeContext);
        container.endContext(request);
        attributeContext.setPreparer("myPreparer");
        attributeContext.setTemplateAttribute((Attribute) notNull());
        container.render("myDefinitionName", request);

        replay(container, attributeContext, request, applicationContext, modelBody);
        model.execute("myDefinitionName", "myTemplate", "myTemplateType",
                "myTemplateExpression", "myRole", "myPreparer",
                false, request, modelBody);
View Full Code Here

        container.prepare("myPreparer", request);
        expect(resolver.computeAttribute(container, attribute, "myName", "myRole", false, "myDefaultValue",
                "myDefaultValueRole", "myDefaultValueType", request)).andReturn(attribute);
        expect(container.startContext(request)).andReturn(attributeContext);
        container.endContext(request);
        container.render(attribute, request);

        replay(resolver, container, request, applicationContext, modelBody);
        model.execute(false, "myPreparer", "myRole", "myDefaultValue", "myDefaultValueRole",
                "myDefaultValueType", "myName", attribute, false, request, modelBody);
        verify(resolver, container, request, applicationContext, modelBody);
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.