Package javax.servlet.jsp

Examples of javax.servlet.jsp.JspWriter


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

            if (body != null) {
                JspWriter out = body.getEnclosingWriter();
                String bodyString = body.getString();
                body.clearBody();
                //Debug.logInfo("printing string: " + bodyString, module);
                out.print(bodyString);
            }
        } catch (IOException e) {
            Debug.logError(e, "IfTag Error.", module);
        }
        return EVAL_PAGE;
View Full Code Here


        else
        {
            buffer.append(TagsSupport.getContextRelativeURL(pageContext,src,true));
        }
        buffer.append("\"/></script>");
        JspWriter writer = pageContext.getOut();
        try
        {
            writer.print(buffer.toString());
        } catch (IOException e)
        {
            throw new JspException(e);
        }
        return (SKIP_BODY);
View Full Code Here

            else {               
                out = new JspWriterAdapter(out);
                pageContext.pushWriter((JspWriter)out);
                usesAdapter = true;
            }
            JspWriter w = new TagWriter(out, tag, pageContext, usesAdapter);
            pageContext.pushTopTag(tag);
            pageContext.pushWriter(w);
            return w;
        }
        catch(TemplateModelException e) {
View Full Code Here

        else
        {
            buffer.append(TagsSupport.getContextRelativeURL(pageContext,src,true));
        }
        buffer.append("\"/></script>");
        JspWriter writer = pageContext.getOut();
        try
        {
            writer.print(buffer.toString());
        } catch (IOException e)
        {
            throw new JspException(e);
        }
        return (SKIP_BODY);
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 {
       
        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);
                String styleId = (String) styleIds.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(">");
                if (styleId != null) {
                    out.print("<label for=\"" + styleId + "\">");
                }
                out.print(label);
                if (styleId != null) {
                    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

                                   oname.toString() + "'");
        }

        // Render this value to our current output writer
        if (value != null) {
            JspWriter out = pageContext.getOut();
            try {
                out.print(value);
            } catch (IOException e) {
                throw new JspException("IOException: " + 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

    {
        if( bodyContent != null )
        {
            try
            {
                JspWriter out = getPreviousOut();
                out.print(bodyContent.getString());
                bodyContent.clearBody();
            }
            catch( IOException e )
            {
                log.error("Unable to get inner tag text", e);
View Full Code Here

        log.info("Request diff between version "+verold+" and "+vernew);

        if( ctx.getPage() != null )
        {
            JspWriter out = pageContext.getOut();

            String diff = engine.getDiff( ctx,
                                          vernew.intValue(),
                                          verold.intValue() );

            if( diff.length() == 0 )
            {
                return EVAL_BODY_INCLUDE;
            }

            out.write( diff );
        }

        return SKIP_BODY;
    }
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.