public int doEndTag()
        throws JspTagException
    {
        HttpServletRequest request = (HttpServletRequest)super.pageContext.getRequest();
        RequestProperties reqState = (RequestProperties)request.getAttribute(SECTION_REQUESTPROPS);
        PrivateLabel     privLabel = (reqState != null)? reqState.getPrivateLabel() : RequestProperties.NullPrivateLabel;
        JspWriter              out = super.pageContext.getOut();
        String                   s = this.getSection().toLowerCase();
        /* ignore blank section definitions */
        if (StringTools.isBlank(s)) {
            // -- ignore
            return EVAL_PAGE;
        }
        /* not a match? */
        if (!this.isMatch()) {
            // -- ignore
            return EVAL_PAGE;
        }
        // --------------------------------------------------------------------
        /* "onload='...'" */
        if (s.equalsIgnoreCase(SECTION_BODY_ONLOAD)) {
            String bodyOnLoad = (String)request.getAttribute(SECTION_BODY_ONLOAD);
            if (!StringTools.isBlank(bodyOnLoad)) {
                try {
                    out.print(bodyOnLoad);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        /* "onunload='...'" */
        if (s.equalsIgnoreCase(SECTION_BODY_ONUNLOAD)) {
            String bodyOnUnload = (String)request.getAttribute(SECTION_BODY_ONUNLOAD);
            if (!StringTools.isBlank(bodyOnUnload)) {
                try {
                    out.print(bodyOnUnload);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        // --------------------------------------------------------------------
        /* expandMenu style */
        if (s.equalsIgnoreCase(SECTION_MENU_STYLE)) {
            try {
                ExpandMenu.writeStyle(out, reqState);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
        /* expandMenu javascript */
        if (s.equalsIgnoreCase(SECTION_MENU_JAVASCRIPT)) {
            try {
                ExpandMenu.writeJavaScript(out, reqState);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
        /* expandMenu */
        if (s.equalsIgnoreCase(SECTION_MENU)) {
            try {
                ExpandMenu.writeMenu(out, reqState, 
                    null/*menuID*/, true/*expandableMenu*/, 
                    false/*showIcon*/, ExpandMenu.DESC_LONG, false/*showMenuHelp*/);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
        // --------------------------------------------------------------------
        /* content table class */
        if (s.equalsIgnoreCase(SECTION_CONTENT_CLASS_TABLE)) {
            HTMLOutput content = (HTMLOutput)request.getAttribute(SECTION_CONTENT_BODY);
            if (content != null) {
                try {
                    String tableClass = content.getTableClass();
                    out.write(!StringTools.isBlank(tableClass)? tableClass : "contentTableClass");
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        /* content cell class */
        if (s.equalsIgnoreCase(SECTION_CONTENT_CLASS_CELL)) {
            HTMLOutput content = (HTMLOutput)request.getAttribute(SECTION_CONTENT_BODY);
            if (content != null) {
                try {
                    String cellClass = content.getCellClass();
                    out.write(!StringTools.isBlank(cellClass)? cellClass : "contentCellClass");
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        /* content message id */
        if (s.equalsIgnoreCase(SECTION_CONTENT_ID_MESSAGE)) {
            try {
                out.write(CommonServlet.ID_CONTENT_MESSAGE);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
        /* content message class */
        if (s.equalsIgnoreCase(SECTION_CONTENT_CLASS_MESSAGE)) {
            try {
                out.write(CommonServlet.CSS_CONTENT_MESSAGE);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
        /* content menubar */
        if (s.equalsIgnoreCase(SECTION_CONTENT_MENUBAR)) {
            HTMLOutput content = (HTMLOutput)request.getAttribute(SECTION_CONTENT_BODY);
            if (content != null) {
                String contentClass = content.getTableClass();
                try {
                    if (ListTools.contains(CommonServlet.CSS_MENUBAR_OK,contentClass)) {
                        MenuBar.writeTableRow(out, reqState.getPageName(), reqState);
                    } else {
                        out.write("<!-- no menubar ['"+contentClass+"'] -->");
                    }
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        /* content message */
        if (s.equalsIgnoreCase(SECTION_CONTENT_MESSAGE)) {
            HTMLOutput content = (HTMLOutput)request.getAttribute(SECTION_CONTENT_BODY);
            String msg = (content != null)? StringTools.trim(content.getTableMessage()) : "";
            try {
                out.write(msg); // TODO: HTML encode?
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
        // --------------------------------------------------------------------
        /* request context path */
        if (s.equalsIgnoreCase(SECTION_REQUEST_CONTEXT)) {
            try {
                out.write(request.getContextPath());
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
        // --------------------------------------------------------------------
        /* CSS file */
        if (s.equalsIgnoreCase(SECTION_CSSFILE)) {
            String cssFilePath = this.getArg();
            if (!StringTools.isBlank(cssFilePath)) {
                try {
                    PrintWriter pw = new PrintWriter(out, out.isAutoFlush());
                    WebPageAdaptor.writeCssLink(pw, reqState, cssFilePath, null);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        // --------------------------------------------------------------------
        /* Banner Image Height */
        if (s.equalsIgnoreCase(SECTION_BANNER_WIDTH)) {
            // key suffix
            String kSfx = StringTools.trim(this.getArg());
            // property values
            String bannerWidth = privLabel.getStringProperty(PrivateLabel.PROP_Banner_width   + kSfx, null);
            if (StringTools.isBlank(bannerWidth)) {
                bannerWidth = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageWidth + kSfx, null);
            }
            // minimum valie
            if (StringTools.isBlank(bannerWidth)) {
                bannerWidth = this.hasDefault()? this.getDefault() : "100%";
            } else
            if (!bannerWidth.endsWith("%")) {
                int W = StringTools.parseInt(bannerWidth, 0);
                bannerWidth = String.valueOf((W < MIN_BANNER_WIDTH)? MIN_BANNER_WIDTH : W);
            }
            // generate html
            try {
                out.write(bannerWidth);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
        /* Banner Style */
        if (s.equalsIgnoreCase(SECTION_BANNER_STYLE)) {
            // key suffix
            String kSfx = StringTools.trim(this.getArg());
            // property values
            String bannerStyle = privLabel.getStringProperty(PrivateLabel.PROP_Banner_style + kSfx, null);
            // generate html
            if (!StringTools.isBlank(bannerStyle)) {
                try {
                    out.write(bannerStyle);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            } else
            if (this.hasDefault()) {
                try {
                    out.write(this.getDefault());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        /* Banner Image */
        if (s.equalsIgnoreCase(SECTION_BANNER_IMAGE)) {
            // key suffix
            String kSfx      = StringTools.trim(this.getArg());
            // property values
            String imgLink   = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageLink   + kSfx, null);
            String imgSrc    = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageSource + kSfx, null);
            String imgWidth  = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageWidth  + kSfx, null);
            String imgHeight = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageHeight + kSfx, null);
            // generate html
            if (!StringTools.isBlank(imgSrc)) {
                StringBuffer sb = new StringBuffer();
                if (!StringTools.isBlank(imgLink)) { 
                    sb.append("<a href='").append(imgLink).append("' target='_blank'>"); 
                }
                sb.append("<img src='").append(imgSrc).append("' border='0'");
                if (!StringTools.isBlank(imgWidth)) {
                    sb.append(" width='").append(imgWidth).append("'");
                }
                if (!StringTools.isBlank(imgHeight)) {
                    sb.append(" height='").append(imgHeight).append("'");
                }
                sb.append(">");
                if (!StringTools.isBlank(imgLink)) {
                    sb.append("</a>");
                }
                try {
                    out.write(sb.toString());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            } else
            if (this.hasDefault()) {
                try {
                    out.write(this.getDefault());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        /* Banner Image */
        if (s.equalsIgnoreCase(SECTION_BANNER_IMAGE_SOURCE)) {
            // key suffix
            String kSfx      = StringTools.trim(this.getArg());
            // property values
            String imgSrc    = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageSource + kSfx, null);
            // generate html
            if (!StringTools.isBlank(imgSrc)) {
                //Print.sysPrintln("Property Image Source: " + imgSrc);
                try {
                    out.write(imgSrc);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            } else
            if (this.hasDefault()) {
                //Print.sysPrintln("Default Image Source: " + this.getDefault());
                try {
                    out.write(this.getDefault());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        /* Banner Image Height */
        if (s.equalsIgnoreCase(SECTION_BANNER_IMAGE_WIDTH)) {
            // key suffix
            String kSfx      = StringTools.trim(this.getArg());
            // property values
            String imgWidth  = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageWidth  + kSfx, null);
            // generate html
            if (!StringTools.isBlank(imgWidth)) {
                try {
                    out.write(imgWidth);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            } else
            if (this.hasDefault()) {
                try {
                    out.write(this.getDefault());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        /* Banner Image Height */
        if (s.equalsIgnoreCase(SECTION_BANNER_IMAGE_HEIGHT)) {
            // key suffix
            String kSfx      = StringTools.trim(this.getArg());
            // property values
            String imgHeight = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageHeight + kSfx, null);
            // generate html
            if (!StringTools.isBlank(imgHeight)) {
                try {
                    out.write(imgHeight);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            } else
            if (this.hasDefault()) {
                try {
                    out.write(this.getDefault());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        // --------------------------------------------------------------------
        /* JavaScript */
        if (s.equalsIgnoreCase(SECTION_JAVASCRIPT)) {
            try {
                // always write "utils.js"
                JavaScriptTools.writeUtilsJS(out, request);
                // check for other javascript 
                Object obj = request.getAttribute(SECTION_JAVASCRIPT);
                if (obj instanceof HTMLOutput) {
                    ((HTMLOutput)obj).write(out); 
                } else {
                    out.write("<!-- Unexpected section type '" + s + "' [" + StringTools.className(obj) + "] -->"); 
                }
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
        // --------------------------------------------------------------------
        /* current page name */
        if (s.equalsIgnoreCase(SECTION_PAGE_NAME)) { // "pagename"
            String pageName = reqState.getPageName();
            if (!StringTools.isBlank(pageName)) {
                try {
                    out.write(pageName);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        // --------------------------------------------------------------------
        /* Page URL */
        if (s.equalsIgnoreCase(SECTION_PAGE_URL)) { // "pageurl"
            String pageName = this.getArg();
            String cmd      = null;
            String cmdArg   = null;
            WebPage wp = privLabel.getWebPage(pageName);
            String url = (wp != null)? wp.encodePageURL(reqState,cmd,cmdArg) : null;
            if (!StringTools.isBlank(url)) {
                try {
                    out.write(url);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
        // --------------------------------------------------------------------
        /* HTMLOutput */
        try {
            Object obj = request.getAttribute(s);
            if (obj == null) {
                out.write("<!-- Undefined section '" + s + "' -->"); 
            } else
            if (obj instanceof HTMLOutput) {
                ((HTMLOutput)obj).write(out); 
            } else {
                out.write("<!-- Unexpected section type '" + s + "' [" + StringTools.className(obj) + "] -->"); 
            }
        } catch (IOException ioe) {
            throw new JspTagException(ioe.toString());
        }
        return EVAL_PAGE;
    }
public int doEndTag()
        throws JspTagException
    {
        HttpServletRequest request = (HttpServletRequest)super.pageContext.getRequest();
        RequestProperties reqState = (RequestProperties)request.getAttribute(SECTION_REQUESTPROPS);
        PrivateLabel     privLabel = (reqState != null)? reqState.getPrivateLabel() : RequestProperties.NullPrivateLabel;
        JspWriter              out = super.pageContext.getOut();
        String                   s = this.getSection().toLowerCase();
       
        if (StringTools.isBlank(s)) {
           
            return EVAL_PAGE;
        }
       
        if (!this.isMatch()) {
           
            return EVAL_PAGE;
        }
       
       
        if (s.equalsIgnoreCase(SECTION_BODY_ONLOAD)) {
            String bodyOnLoad = (String)request.getAttribute(SECTION_BODY_ONLOAD);
            if (!StringTools.isBlank(bodyOnLoad)) {
                try {
                    out.print(bodyOnLoad);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_BODY_ONUNLOAD)) {
            String bodyOnUnload = (String)request.getAttribute(SECTION_BODY_ONUNLOAD);
            if (!StringTools.isBlank(bodyOnUnload)) {
                try {
                    out.print(bodyOnUnload);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
       
        if (s.equalsIgnoreCase(SECTION_MENU_STYLE)) {
            try {
                ExpandMenu.writeStyle(out, reqState);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_MENU_JAVASCRIPT)) {
            try {
                ExpandMenu.writeJavaScript(out, reqState);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_MENU)) {
            try {
                ExpandMenu.writeMenu(out, reqState, 
                    nul, tru, 
                    fals, ExpandMenu.DESC_LONG, fals);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
       
       
        if (s.equalsIgnoreCase(SECTION_CONTENT_CLASS_TABLE)) {
            HTMLOutput content = (HTMLOutput)request.getAttribute(SECTION_CONTENT_BODY);
            if (content != null) {
                try {
                    String tableClass = content.getTableClass();
                    out.write(!StringTools.isBlank(tableClass)? tableClass : "contentTableClass");
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_CONTENT_CLASS_CELL)) {
            HTMLOutput content = (HTMLOutput)request.getAttribute(SECTION_CONTENT_BODY);
            if (content != null) {
                try {
                    String cellClass = content.getCellClass();
                    out.write(!StringTools.isBlank(cellClass)? cellClass : "contentCellClass");
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_CONTENT_ID_MESSAGE)) {
            try {
                out.write(CommonServlet.ID_CONTENT_MESSAGE);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_CONTENT_CLASS_MESSAGE)) {
            try {
                out.write(CommonServlet.CSS_CONTENT_MESSAGE);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_CONTENT_MENUBAR)) {
            HTMLOutput content = (HTMLOutput)request.getAttribute(SECTION_CONTENT_BODY);
            if (content != null) {
                String contentClass = content.getTableClass();
                try {
                    if (ListTools.contains(CommonServlet.CSS_MENUBAR_OK,contentClass)) {
                        MenuBar.writeTableRow(out, reqState.getPageName(), reqState);
                    } else {
                        out.write("<!-- no menubar ['"+contentClass+"'] -->");
                    }
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_CONTENT_MESSAGE)) {
            HTMLOutput content = (HTMLOutput)request.getAttribute(SECTION_CONTENT_BODY);
            String msg = (content != null)? StringTools.trim(content.getTableMessage()) : "";
            try {
                out.write(msg);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
       
       
        if (s.equalsIgnoreCase(SECTION_REQUEST_CONTEXT)) {
            try {
                out.write(request.getContextPath());
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
       
       
        if (s.equalsIgnoreCase(SECTION_CSSFILE)) {
            String cssFilePath = this.getArg();
            if (!StringTools.isBlank(cssFilePath)) {
                try {
                    PrintWriter pw = new PrintWriter(out, out.isAutoFlush());
                    WebPageAdaptor.writeCssLink(pw, reqState, cssFilePath, null);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
       
        if (s.equalsIgnoreCase(SECTION_BANNER_WIDTH)) {
           
            String kSfx = StringTools.trim(this.getArg());
           
            String bannerWidth = privLabel.getStringProperty(PrivateLabel.PROP_Banner_width   + kSfx, null);
            if (StringTools.isBlank(bannerWidth)) {
                bannerWidth = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageWidth + kSfx, null);
            }
           
            if (StringTools.isBlank(bannerWidth)) {
                bannerWidth = this.hasDefault()? this.getDefault() : "100%";
            } else
            if (!bannerWidth.endsWith("%")) {
                int W = StringTools.parseInt(bannerWidth, 0);
                bannerWidth = String.valueOf((W < MIN_BANNER_WIDTH)? MIN_BANNER_WIDTH : W);
            }
           
            try {
                out.write(bannerWidth);
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_BANNER_STYLE)) {
           
            String kSfx = StringTools.trim(this.getArg());
           
            String bannerStyle = privLabel.getStringProperty(PrivateLabel.PROP_Banner_style + kSfx, null);
           
            if (!StringTools.isBlank(bannerStyle)) {
                try {
                    out.write(bannerStyle);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            } else
            if (this.hasDefault()) {
                try {
                    out.write(this.getDefault());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_BANNER_IMAGE)) {
           
            String kSfx      = StringTools.trim(this.getArg());
           
            String imgLink   = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageLink   + kSfx, null);
            String imgSrc    = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageSource + kSfx, null);
            String imgWidth  = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageWidth  + kSfx, null);
            String imgHeight = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageHeight + kSfx, null);
           
            if (!StringTools.isBlank(imgSrc)) {
                StringBuffer sb = new StringBuffer();
                if (!StringTools.isBlank(imgLink)) { 
                    sb.append("<a href='").append(imgLink).append("' target='_blank'>"); 
                }
                sb.append("<img src='").append(imgSrc).append("' border='0'");
                if (!StringTools.isBlank(imgWidth)) {
                    sb.append(" width='").append(imgWidth).append("'");
                }
                if (!StringTools.isBlank(imgHeight)) {
                    sb.append(" height='").append(imgHeight).append("'");
                }
                sb.append(">");
                if (!StringTools.isBlank(imgLink)) {
                    sb.append("</a>");
                }
                try {
                    out.write(sb.toString());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            } else
            if (this.hasDefault()) {
                try {
                    out.write(this.getDefault());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_BANNER_IMAGE_SOURCE)) {
           
            String kSfx      = StringTools.trim(this.getArg());
           
            String imgSrc    = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageSource + kSfx, null);
           
            if (!StringTools.isBlank(imgSrc)) {
               
                try {
                    out.write(imgSrc);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            } else
            if (this.hasDefault()) {
               
                try {
                    out.write(this.getDefault());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_BANNER_IMAGE_WIDTH)) {
           
            String kSfx      = StringTools.trim(this.getArg());
           
            String imgWidth  = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageWidth  + kSfx, null);
           
            if (!StringTools.isBlank(imgWidth)) {
                try {
                    out.write(imgWidth);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            } else
            if (this.hasDefault()) {
                try {
                    out.write(this.getDefault());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
        if (s.equalsIgnoreCase(SECTION_BANNER_IMAGE_HEIGHT)) {
           
            String kSfx      = StringTools.trim(this.getArg());
           
            String imgHeight = privLabel.getStringProperty(PrivateLabel.PROP_Banner_imageHeight + kSfx, null);
           
            if (!StringTools.isBlank(imgHeight)) {
                try {
                    out.write(imgHeight);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            } else
            if (this.hasDefault()) {
                try {
                    out.write(this.getDefault());
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
       
        if (s.equalsIgnoreCase(SECTION_JAVASCRIPT)) {
            try {
               
                JavaScriptTools.writeUtilsJS(out, request);
               
                Object obj = request.getAttribute(SECTION_JAVASCRIPT);
                if (obj instanceof HTMLOutput) {
                    ((HTMLOutput)obj).write(out); 
                } else {
                    out.write("<!-- Unexpected section type '" + s + "' [" + StringTools.className(obj) + "] -->"); 
                }
            } catch (IOException ioe) {
                throw new JspTagException(ioe.toString());
            }
            return EVAL_PAGE;
        }
       
       
        if (s.equalsIgnoreCase(SECTION_PAGE_NAME)) {
            String pageName = reqState.getPageName();
            if (!StringTools.isBlank(pageName)) {
                try {
                    out.write(pageName);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
       
        if (s.equalsIgnoreCase(SECTION_PAGE_URL)) {
            String pageName = this.getArg();
            String cmd      = null;
            String cmdArg   = null;
            WebPage wp = privLabel.getWebPage(pageName);
            String url = (wp != null)? wp.encodePageURL(reqState,cmd,cmdArg) : null;
            if (!StringTools.isBlank(url)) {
                try {
                    out.write(url);
                } catch (IOException ioe) {
                    throw new JspTagException(ioe.toString());
                }
            }
            return EVAL_PAGE;
        }
       
       
        try {
            Object obj = request.getAttribute(s);
            if (obj == null) {
                out.write("<!-- Undefined section '" + s + "' -->"); 
            } else
            if (obj instanceof HTMLOutput) {
                ((HTMLOutput)obj).write(out); 
            } else {
                out.write("<!-- Unexpected section type '" + s + "' [" + StringTools.className(obj) + "] -->"); 
            }
        } catch (IOException ioe) {
            throw new JspTagException(ioe.toString());
        }
        return EVAL_PAGE;
    }
public int doendtag() throws jsptagexception { httpservletrequest request = (httpservletrequest)super.pagecontext.getrequest(); requestproperties reqstate = (requestproperties)request.getattribute(section_requestprops); privatelabel privlabel = (reqstate != null)? reqstate.getprivatelabel() : requestproperties.nullprivatelabel; jspwriter out = super.pagecontext.getout(); string s = this.getsection().tolowercase(); if (stringtools.isblank(s)) { return eval_page; } if (!this.ismatch()) { return eval_page; } if (s.equalsignorecase(section_body_onload)) { string bodyonload = (string)request.getattribute(section_body_onload); if (!stringtools.isblank(bodyonload)) { try { out.print(bodyonload); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_body_onunload)) { string bodyonunload = (string)request.getattribute(section_body_onunload); if (!stringtools.isblank(bodyonunload)) { try { out.print(bodyonunload); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_menu_style)) { try { expandmenu.writestyle(out, reqstate); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } return eval_page; } if (s.equalsignorecase(section_menu_javascript)) { try { expandmenu.writejavascript(out, reqstate); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } return eval_page; } if (s.equalsignorecase(section_menu)) { try { expandmenu.writemenu(out, reqstate, nul, tru, fals, expandmenu.desc_long, fals); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } return eval_page; } if (s.equalsignorecase(section_content_class_table)) { htmloutput content = (htmloutput)request.getattribute(section_content_body); if (content != null) { try { string tableclass = content.gettableclass(); out.write(!stringtools.isblank(tableclass)? tableclass : "contenttableclass"); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_content_class_cell)) { htmloutput content = (htmloutput)request.getattribute(section_content_body); if (content != null) { try { string cellclass = content.getcellclass(); out.write(!stringtools.isblank(cellclass)? cellclass : "contentcellclass"); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_content_id_message)) { try { out.write(commonservlet.id_content_message); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } return eval_page; } if (s.equalsignorecase(section_content_class_message)) { try { out.write(commonservlet.css_content_message); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } return eval_page; } if (s.equalsignorecase(section_content_menubar)) { htmloutput content = (htmloutput)request.getattribute(section_content_body); if (content != null) { string contentclass = content.gettableclass(); try { if (listtools.contains(commonservlet.css_menubar_ok,contentclass)) { menubar.writetablerow(out, reqstate.getpagename(), reqstate); } else { out.write("<!-- no menubar ['"+contentclass+"'] -->"); } } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_content_message)) { htmloutput content = (htmloutput)request.getattribute(section_content_body); string msg = (content != null)? stringtools.trim(content.gettablemessage()) : ""; try { out.write(msg); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } return eval_page; } if (s.equalsignorecase(section_request_context)) { try { out.write(request.getcontextpath()); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } return eval_page; } if (s.equalsignorecase(section_cssfile)) { string cssfilepath = this.getarg(); if (!stringtools.isblank(cssfilepath)) { try { printwriter pw = new printwriter(out, out.isautoflush()); webpageadaptor.writecsslink(pw, reqstate, cssfilepath, null); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_banner_width)) { string ksfx = stringtools.trim(this.getarg()); string bannerwidth = privlabel.getstringproperty(privatelabel.prop_banner_width + ksfx, null); if (stringtools.isblank(bannerwidth)) { bannerwidth = privlabel.getstringproperty(privatelabel.prop_banner_imagewidth + ksfx, null); } if (stringtools.isblank(bannerwidth)) { bannerwidth = this.hasdefault()? this.getdefault() : "100%"; } else if (!bannerwidth.endswith("%")) { int w = stringtools.parseint(bannerwidth, 0); bannerwidth = string.valueof((w < min_banner_width)? min_banner_width : w); } try { out.write(bannerwidth); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } return eval_page; } if (s.equalsignorecase(section_banner_style)) { string ksfx = stringtools.trim(this.getarg()); string bannerstyle = privlabel.getstringproperty(privatelabel.prop_banner_style + ksfx, null); if (!stringtools.isblank(bannerstyle)) { try { out.write(bannerstyle); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } else if (this.hasdefault()) { try { out.write(this.getdefault()); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_banner_image)) { string ksfx = stringtools.trim(this.getarg()); string imglink = privlabel.getstringproperty(privatelabel.prop_banner_imagelink + ksfx, null); string imgsrc = privlabel.getstringproperty(privatelabel.prop_banner_imagesource + ksfx, null); string imgwidth = privlabel.getstringproperty(privatelabel.prop_banner_imagewidth + ksfx, null); string imgheight = privlabel.getstringproperty(privatelabel.prop_banner_imageheight + ksfx, null); if (!stringtools.isblank(imgsrc)) { stringbuffer sb = new stringbuffer(); if (!stringtools.isblank(imglink)) { sb.append("<a href='").append(imglink).append("' target='_blank'>"); } sb.append("<img src='").append(imgsrc).append("' border='0'"); if (!stringtools.isblank(imgwidth)) { sb.append(" width='").append(imgwidth).append("'"); } if (!stringtools.isblank(imgheight)) { sb.append(" height='").append(imgheight).append("'"); } sb.append(">"); if (!stringtools.isblank(imglink)) { sb.append("</a>"); } try { out.write(sb.tostring()); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } else if (this.hasdefault()) { try { out.write(this.getdefault()); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_banner_image_source)) { string ksfx = stringtools.trim(this.getarg()); string imgsrc = privlabel.getstringproperty(privatelabel.prop_banner_imagesource + ksfx, null); if (!stringtools.isblank(imgsrc)) { try { out.write(imgsrc); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } else if (this.hasdefault()) { try { out.write(this.getdefault()); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_banner_image_width)) { string ksfx = stringtools.trim(this.getarg()); string imgwidth = privlabel.getstringproperty(privatelabel.prop_banner_imagewidth + ksfx, null); if (!stringtools.isblank(imgwidth)) { try { out.write(imgwidth); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } else if (this.hasdefault()) { try { out.write(this.getdefault()); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_banner_image_height)) { string ksfx = stringtools.trim(this.getarg()); string imgheight = privlabel.getstringproperty(privatelabel.prop_banner_imageheight + ksfx, null); if (!stringtools.isblank(imgheight)) { try { out.write(imgheight); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } else if (this.hasdefault()) { try { out.write(this.getdefault()); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_javascript)) { try { javascripttools.writeutilsjs(out, request); object obj = request.getattribute(section_javascript); if (obj instanceof htmloutput) { ((htmloutput)obj).write(out); } else { out.write("<!-- unexpected section type '" + s + "' [" + stringtools.classname(obj) + "] -->"); } } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } return eval_page; } if (s.equalsignorecase(section_page_name)) { string pagename = reqstate.getpagename(); if (!stringtools.isblank(pagename)) { try { out.write(pagename); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } if (s.equalsignorecase(section_page_url)) { string pagename = this.getarg(); string cmd = null; string cmdarg = null; webpage wp = privlabel.getwebpage(pagename); string url = (wp != null)? wp.encodepageurl(reqstate,cmd,cmdarg) : null; if (!stringtools.isblank(url)) { try { out.write(url); } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } } return eval_page; } try { object obj = request.getattribute(s); if (obj == null) { out.write("<!-- undefined section '" + s + "' -->"); } else if (obj instanceof htmloutput) { ((htmloutput)obj).write(out); } else { out.write("<!-- unexpected section type '" + s + "' [" + stringtools.classname(obj) + "] -->"); } } catch (ioexception ioe) { throw new jsptagexception(ioe.tostring()); } return eval_page; }