Package org.apache.tiles.impl

Examples of org.apache.tiles.impl.BasicTilesContainer.startContext()


        if (attributeToRender == null) {
          throw new ServletException("No tiles attribute with a name of '" + element
              + "' could be found for the current view: " + this);
        } else {
          container.startContext(request, response).inheritCascadedAttributes(compositeDefinition);
          container.render(attributeToRender, request, response);
          container.endContext(request, response);
        }
      }
    } else {
View Full Code Here


  public void testRenderFragment_DynamicAttribute() throws Exception {
    ApplicationContext tilesAppContext = new WildcardServletApplicationContext(servletContext);
    Request tilesRequest = new ServletRequest(tilesAppContext, request, response);
    BasicTilesContainer container = (BasicTilesContainer) TilesAccess.getContainer(tilesAppContext);
    AttributeContext attributeContext = container.startContext(tilesRequest);
    attributeContext.putAttribute("body", new Attribute("/WEB-INF/dynamicTemplate.jsp"));
    Map<String, Attribute> resultMap = new HashMap<String, Attribute>();
    ajaxTilesView.addRuntimeAttributes(container, tilesRequest, resultMap);
    assertNotNull(resultMap.get("body"));
    assertEquals("/WEB-INF/dynamicTemplate.jsp", resultMap.get("body").toString());
View Full Code Here

        Attribute attributeToRender = flattenedAttributeMap.get(element);
        if (attributeToRender == null) {
          throw new ServletException("No tiles attribute with a name of '" + element
              + "' could be found for the current view: " + this);
        }
        container.startContext(tilesRequest).inheritCascadedAttributes(compositeDefinition);
        container.render(attributeToRender, tilesRequest);
        container.endContext(tilesRequest);
      }
    } else {
      super.renderMergedOutputModel(model, request, response);
View Full Code Here

  }

  public void testRenderFragment_DynamicAttribute() throws Exception {
    BasicTilesContainer container = (BasicTilesContainer) ServletUtil.getCurrentContainer(request, servletContext);
    Object[] requestItems = new Object[] { request, response };
    AttributeContext attributeContext = container.startContext(requestItems);
    attributeContext.putAttribute("body", new Attribute("/WEB-INF/dynamicTemplate.jsp"));
    Map<String, Attribute> resultMap = new HashMap<String, Attribute>();
    ajaxTilesView.addRuntimeAttributes(container, resultMap, request, response);
    assertNotNull(resultMap.get("body"));
    assertEquals("/WEB-INF/dynamicTemplate.jsp", resultMap.get("body").toString());
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.