Package javax.servlet.jsp

Examples of javax.servlet.jsp.JspWriter


    *
    **/

    public int doStartTag() throws JspException
    {
        JspWriter out = pageContext.getOut();

        try
        {
            out.print("<a");

            if (_styleClass != null)
            {
                out.print(" class=\"");
                out.print(_styleClass);
                out.print('"');
            }

            out.print(" href=\"");

            getURLRetriever().insertURL(getServlet());

            // And we're back!  Finish off the tag.

            out.print("\">");
        }
        catch (IOException ex)
        {
            throw new JspException(
                Tapestry.format("AbstractLinkTag.io-exception", ex.getMessage()));
View Full Code Here


            RenderResponse response = (RenderResponse)
                pageContext.getRequest().getAttribute("javax.portlet.response");
           
            if (request == null || response == null)
            {
                JspWriter out = pageContext.getOut();
                out.print("request response not found");
                return SKIP_BODY;
            }
            PortletApplicationModel model = (PortletApplicationModel)request.getAttribute(FrameworkConstants.MODEL_TOOL);
            if (model == null)
            {
                JspWriter out = pageContext.getOut();
                out.print("model not found");
                return SKIP_BODY;
            }
                                               
            Forwarder forwarder = new Forwarder(model, request, response);
            if (view != null)
            {
                content = forwarder.getView(view).toString();
            }
            else if (forward != null)
            {
                if (action != null)
                {
                    content = forwarder.getLink(forward, action).toString();
                }
                else
                {
                    content = forwarder.getLink(forward).toString();                   
                }
            }
            else
            {
                content = forwarder.toString();
            }
            JspWriter out = pageContext.getOut();
            out.print(content);           
        }
        catch (IOException e)
        {
            System.err.println("Error printing tag: " + e);
        }
View Full Code Here

     * @exception JspException if a processing error occurs
     */
    public int doEndTag() throws JspException {

        TreeControl treeControl = getTreeControl();
        JspWriter out = pageContext.getOut();
        try {
            out.print
                ("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"");
            if (style != null) {
                out.print(" class=\"");
                out.print(style);
                out.print("\"");
            }
            out.println(">");
            int level = 0;
            TreeControlNode node = treeControl.getRoot();
            render(out, node, level, treeControl.getWidth(), true);
            out.println("</table>");
        } catch (IOException e) {
            throw new JspException(e);
        }

        return (EVAL_PAGE);
View Full Code Here

     *
     * @exception JspException if a processing error occurs
     */
    public int doEndTag() throws JspException {
       
        JspWriter out = pageContext.getOut();
       
        try {
           
            // Render the beginning of this element
            out.println();
            out.print("<table ");
            if (columns > 2) {
                out.print(" columns=\"");
                out.print(columns);
                out.print("\"");
            }
            if (tableStyle != null) {
                out.print(" class=\"");
                out.print(tableStyle);
                out.print("\"");
                out.print(" border=\"1\" cellspacing=\"0\" ");
                out.print(" cellpadding=\"0\" width=\"100%\" ");
            }
            out.println(">");
           
           
            // Render each defined row
            int n = labels.size();
            for (int i = 0; i < n; i++) {
                String label = (String) labels.get(i);
                boolean header = ((Boolean) headers.get(i)).booleanValue();
                String data = (String) datas.get(i);
                String labelStyle = (String) labelStyles.get(i);
                String dataStyle = (String) dataStyles.get(i);
               
                if (header)
                    out.println("<tr class=\"header-row\" >");
                else out.println("<tr>");
               
                out.println("  <td width=\"27%\"> ");
               
                out.print("    <div align=\"left\"");
                if (labelStyle != null)
                    out.print( " class=\"" + labelStyle +"\"");
                out.print(">");
                out.print(label);
                out.println("    </div>");
                out.println("  </td>");
               
                out.println("  <td width=\"73%\"> ");
                out.print("    <div align=\"left\"" );
                if (dataStyle != null)
                    out.print(" class=\"" + dataStyle + "\"");
                out.print(">");
                out.print(data);
                out.println("    </div>");
                out.print("  </td>");
                out.println("</tr>");
               
                /*
                if (!header) {
                    out.println("<tr height=\"1\">");
                    out.println("  <td class=\""+ lineStyle + "\" colspan=\"2\">");
                    out.println("    <img src=\"\" alt=\"\" width=\"1\" height=\"1\" border=\"0\">");
                    out.println("  </td>");
                    out.println("</tr>");
                }
                 */
            }
           
            // Render the end of this element
            out.println("</table>");
            out.println();
           
        } catch (IOException e) {
            throw new JspException(e);
        }
       
View Full Code Here

     *
     * @exception JspException if a processing error occurs
     */
    public int doEndTag() throws JspException {

        JspWriter out = pageContext.getOut();

        try {

            // Render (once only) the JavaScript function we need
            if (pageContext.getAttribute(FUNCTION_TAG) == null) {
                out.println();
                out.println("<script language=\"JavaScript\">");
                out.println("<!--");
                out.println("function IA_jumpMenu(targ,selObj) {");
                out.println("  dest = selObj.options[selObj.selectedIndex].value;");
                out.println("  if (dest.length > 0) {");
                out.println("    eval(targ+\".location='\"+dest+\"'\");");
                out.println("  }");
                out.println("}");
                out.println("//-->");
                out.println("</script>");
                out.println();
                pageContext.setAttribute(FUNCTION_TAG, Boolean.TRUE);
            }

            // Render the beginning of this element
            out.println();
            out.print("<select");
            if (size > 1) {
                out.print(" size=\"");
                out.print(size);
                out.print("\"");
            }
            if (style != null) {
                out.print(" class=\"");
                out.print(style);
                out.print("\"");
            }
            out.print(" onchange=\"IA_jumpMenu('self',this)\"");
            out.println(">");

            // Render each defined action
            int n = labels.size();
            for (int i = 0; i < n; i++) {
                String label = (String) labels.get(i);
                boolean selected = ((Boolean) selecteds.get(i)).booleanValue();
                boolean disabled = ((Boolean) disableds.get(i)).booleanValue();            
                String url = (String) urls.get(i);
                out.print("<option");
                if (selected)
                    out.print(" selected=\"selected\"");
                if (disabled)
                    out.print(" disabled=\"true\"");               
                out.print(" value=\"");
                if (url != null)
                    out.print(url);
                out.print("\"");
                out.print(">");
                if (label != null)
                    out.print(label);
                out.println("</option>");
            }

            // Render the end of this element
            out.println("</select>");
            out.println();

        } catch (IOException e) {
            throw new JspException(e);
        }

View Full Code Here

            } else {
                fieldString = "";
            }
        }

        JspWriter out = pageContext.getOut();

        if (fieldString.length() > 0) {
            if (prefix != null)
                out.print(prefix);
            out.print(fieldString);
            if (suffix != null)
                out.print(suffix);
        }
    }
View Full Code Here

    public int doEndTag() {
        try {
            BodyContent body = getBodyContent();

            if (body != null) {
                JspWriter out = body.getEnclosingWriter();
                String bodyString = body.getString();
                body.clearBody();
                out.print(bodyString);
            }
        } catch (IOException e) {
            Debug.logInfo("IteratorTag IO Error", module);
            Debug.logInfo(e, module);
        }
View Full Code Here

    public int doEndTag() {
        try {
            BodyContent body = getBodyContent();

            if (body != null) {
                JspWriter out = body.getEnclosingWriter();
                String bodyString = body.getString();
                body.clearBody();
                out.print(bodyString);
            }
        } catch (IOException e) {
            System.out.println("IterateNext Tag error: " + e);
        }
        return EVAL_PAGE;
View Full Code Here

        if (obj == null)
            obj = defaultStr;

        try {
            JspWriter out = pageContext.getOut();

            out.print(obj.toString());
        } catch (IOException e) {
            if (UtilJ2eeCompat.useNestedJspException(pageContext.getServletContext())) {
                throw new JspException(e.getMessage(), e);
            } else {
                Debug.logError(e, "Server does not support nested exceptions, here is the exception", module);
View Full Code Here

    public int doEndTag() {
        try {
            BodyContent body = getBodyContent();

            if (body != null) {
                JspWriter out = body.getEnclosingWriter();
                String bodyString = body.getString();
                body.clearBody();
                out.print(bodyString);
            }
        } catch (IOException e) {
            System.out.println("IterateNext Tag error: " + e);
        }
        return EVAL_PAGE;
View Full Code Here

TOP

Related Classes of javax.servlet.jsp.JspWriter

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.