FileDocCategorySizeDatePackage
ContainerIncludeTag.javaAPI DocExample1345Sat Nov 22 20:33:22 GMT 2003cvexample.view

ContainerIncludeTag

public class ContainerIncludeTag extends TagSupport
A custom tag that is nested within a Container tag to include an element of a composite.

Fields Summary
private String
name
the name of the element to include
Constructors Summary
Methods Summary
public intdoEndTag()
Get the view from the current container, and map the name of this include to a page to include in that view

        // find the Container tag and get the view from it
        ContainerTag ct =
            (ContainerTag) findAncestorWithClass(this, ContainerTag.class);     
        View v = ct.getView();
        
        // get the url for this view
        String viewURL = v.getUrl(ct.getName(), name);
        if (viewURL != null) {
            try {    
                // include it
                pageContext.include(viewURL);
            } catch( Exception ex ) {
                throw new JspException("Unable to include " + viewURL, ex);
            }
        }
        return EVAL_PAGE;
    
public voidsetName(java.lang.String value)
Used by the container to set the name of this composite element

        name = value;