Package org.apache.tiles.template

Examples of org.apache.tiles.template.AddListAttributeModel


     * @since 2.2.0
     */
    public TilesFMModelRepository() {
        addAttribute = new AddAttributeFMModel(new AddAttributeModel());
        addListAttribute = new AddListAttributeFMModel(
                new AddListAttributeModel());
        definition = new DefinitionFMModel(new DefinitionModel());
        AttributeResolver attributeResolver = new DefaultAttributeResolver();
        getAsString = new GetAsStringFMModel(new GetAsStringModel(
                attributeResolver));
        importAttribute = new ImportAttributeFMModel(new ImportAttributeModel());
View Full Code Here


    public TilesVelocityRepository(ServletContext servletContext) {
        AttributeResolver attributeResolver = new DefaultAttributeResolver();

        addAttribute = new AddAttributeVModel(new AddAttributeModel());
        addListAttribute = new AddListAttributeVModel(
                new AddListAttributeModel());
        definition = new DefinitionVModel(new DefinitionModel(), servletContext);
        getAsString = new GetAsStringVModel(new GetAsStringModel(
                attributeResolver), servletContext);
        importAttribute = new ImportAttributeVModel(new ImportAttributeModel(),
                servletContext);
View Full Code Here

    public TilesVelocityRepository(ServletContext servletContext) {
        AttributeResolver attributeResolver = new DefaultAttributeResolver();

        addAttribute = new AddAttributeVModel(new AddAttributeModel());
        addListAttribute = new AddListAttributeVModel(
                new AddListAttributeModel());
        definition = new DefinitionVModel(new DefinitionModel(), servletContext);
        getAsString = new GetAsStringVModel(new GetAsStringModel(
                attributeResolver), servletContext);
        importAttribute = new ImportAttributeVModel(new ImportAttributeModel(),
                servletContext);
View Full Code Here

     * @throws IOException If something goes wrong.
     * @throws TemplateException If something goes wrong.
     */
    @Test
    public void testExecute() throws TemplateException, IOException {
        AddListAttributeModel tModel = createMock(AddListAttributeModel.class);
        AddListAttributeFMModel fmModel = new AddListAttributeFMModel(tModel);
        HttpServletRequest request = createMock(HttpServletRequest.class);

        HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper);
        expect(model.get(FreemarkerServlet.KEY_REQUEST)).andReturn(requestModel);
        initEnvironment();

        TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class);
        ArrayStack<Object> composeStack = new ArrayStack<Object>();
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("role", objectWrapper.wrap("myRole"));

        expect(request.getAttribute(FreeMarkerUtil.COMPOSE_STACK_ATTRIBUTE_NAME)).andReturn(composeStack);
        tModel.start(composeStack, "myRole");
        tModel.end(composeStack);
        body.render(isA(NullWriter.class));

        replay(request, tModel, body);
        fmModel.execute(env, params, null, body);
        verify(template, model, request, tModel, body);
View Full Code Here

TOP

Related Classes of org.apache.tiles.template.AddListAttributeModel

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.