Package org.apache.tiles

Examples of org.apache.tiles.Attribute


     *
     * @throws IOException If something goes wrong, but it's not a Tiles
     * exception.
     */
    public void testObjectAttribute() throws IOException {
        Attribute attribute = new Attribute();
        HttpServletRequest request = new MockHttpServletRequest();
        HttpServletResponse response = new MockHttpServletResponse();
        boolean exceptionFound = false;

        attribute.setValue(new Integer(SAMPLE_INT)); // A simple object
        try {
            container.render(attribute, null, request, response);
        } catch (TilesException e) {
            LOG.debug("Intercepted a TilesException, it is correct", e);
            exceptionFound = true;
View Full Code Here


    public void testAttributeCredentials() throws TilesException, IOException {
        RoleMockHttpServletRequest request = new RoleMockHttpServletRequest("myrole");
        MockHttpSession session = new MockHttpSession();
        request.setHttpSession(session);
        MockHttpServletResponse response = new MockHttpServletResponse();
        Attribute attribute = new Attribute((Object) "This is the value", "myrole");
        StringWriter writer = new StringWriter();
        container.render(attribute, writer, request, response);
        writer.close();
        assertEquals("The attribute should have been rendered", writer
                .toString(), "This is the value");
View Full Code Here

     * </p>
     *
     * @param nestedTag the put tag desciendent.
     */
    public void processNestedTag(PutAttributeTag nestedTag) {
        Attribute attribute = new Attribute(
            nestedTag.getValue(), nestedTag.getRole(),
            nestedTag.getType());

        attributeContext.putAttribute(nestedTag.getName(), attribute, nestedTag
                .isCascade());
View Full Code Here

                        + "Attribute with null key found.");
            } else if (name == null) {
                continue;
            }

            Attribute attr = attributeContext.getAttribute(name);

            if (attr != null) {
                try {
                    Object attributeValue = container.evaluate(attr, pageContext);
                    if (attributeValue == null) {
View Full Code Here

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

        this.addValue(attribute);
    }
View Full Code Here

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

        this.addValue(attribute);
    }
View Full Code Here

     *
     * @param nestedTag The nested <code>PutAttributeTag</code>
     * @throws TilesJspException Never thrown, it's here for API compatibility.
     */
    public void processNestedTag(PutAttributeTag nestedTag) throws TilesJspException {
        Attribute attr = new Attribute(nestedTag.getValue(),
            nestedTag.getRole(), nestedTag.getType());
        definition.putAttribute(nestedTag.getName(), attr, nestedTag
                .isCascade());
    }
View Full Code Here

     *
     * @throws IOException If something goes wrong during rendition.
     */
    public void testWrite() throws IOException {
        StringWriter writer = new StringWriter();
        Attribute attribute = new Attribute("my.definition", null, "definition");
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesRequestContextFactory contextFactory = EasyMock
                .createMock(TilesRequestContextFactory.class);
        TilesContainer container = EasyMock.createMock(TilesContainer.class);
View Full Code Here

     *
     * @throws IOException If something goes wrong during rendition.
     */
    public void testWrite() throws IOException {
        StringWriter writer = new StringWriter();
        Attribute attribute = new Attribute("/myTemplate.jsp", null, "template");
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesRequestContextFactory contextFactory = EasyMock
                .createMock(TilesRequestContextFactory.class);
        TilesRequestContext requestContext = EasyMock
View Full Code Here

     *
     * @throws IOException If something goes wrong during rendition.
     */
    public void testWrite() throws IOException {
        StringWriter writer = new StringWriter();
        Attribute attribute = new Attribute("Result", null, "string");
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesRequestContextFactory contextFactory = EasyMock
                .createMock(TilesRequestContextFactory.class);
        TilesRequestContext requestContext = EasyMock
View Full Code Here

TOP

Related Classes of org.apache.tiles.Attribute

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.