String actualPage = JSPManager.getLocalJSP(page);
HttpServletRequest hrq = (HttpServletRequest) pageContext.getRequest(); String actualPage = hrq.getContextPath() + JSPManager.getLocalJSP(page);
    public int doAfterBody()        throws JspException    {        /*         * The output is the following, with PAGE and TEXT replaced appropriately:         *          * <SCRIPT TYPE="text/javascript">         * <!--         * document.write('<A HREF="#" onClick="var popupwin = window.open(\'PAGE\',\'dspacepopup\',\'height=600,width=550,resizable,scrollbars\');popupwin.focus();return false;">TEXT<\/a>');         * // -->         * </SCRIPT>         * <NOSCRIPT>         * <a href="PAGE" target="dspacepopup">TEXT</a>.         * </NOSCRIPT>         *         * The script writes a Javascripted link which opens the popup window 600x550,         * or brings it to the front if it's already open.  If Javascript is not         * available, plain HTML link in the NOSCRIPT element is used.         */        BodyContent bc = getBodyContent();        String linkText = bc.getString();        bc.clearBody();                String actualPage = JSPManager.getLocalJSP(page);        String html = "<SCRIPT TYPE=\"text/javascript\">\n" +            "<!-- Javascript starts here\n" +            "document.write('<A HREF=\"#\" onClick=\"var popupwin = window.open(\\'" +            actualPage +            "\\',\\'dspacepopup\\',\\'height=600,width=550,resizable,scrollbars\\');popupwin.focus();return false;\">" +            linkText + "<\\/a>');\n" +            "// -->\n" +            "</SCRIPT><NOSCRIPT><A HREF=\"" + actualPage + "\" TARGET=\"dspacepopup\">" +            linkText + "</A></NOSCRIPT>";                try        {            getPreviousOut().print(html);        }        catch (IOException ie)        {            throw new JspException(ie);        }        return SKIP_BODY;    }