Examples of JspWriter


Examples of javax.servlet.jsp.JspWriter

     * @see net.sf.jportlet.web.taglib.BaseTag#doStartHtml(javax.servlet.http.HttpServletRequest)
     */
    protected int doStartHtml( HttpServletRequest request )
        throws IOException
    {
    JspWriter out = pageContext.getOut(  );
   
    out.write( "<td valign='top'" );
    
    outputCss();
   
    if ( _width != null )
    {
      out.write( " width='" +  _width + "'");
    }
   
        out.write( "><table width='100%' border='0' cellspacing='0' cellpadding='0'>\n" );
        return EVAL_BODY_INCLUDE;
    }
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

        String ctx = ((HttpServletRequest)(pageContext.getRequest())).getContextPath();
        Preferences prefs = Preferences.systemRoot().node("net/sourceforge/geekblog" + ctx);

        String headshots = prefs.get("weblog.headshotsdir", "images");
        Set headshotsDir = pageContext.getServletContext().getResourcePaths(headshots);
        JspWriter out = pageContext.getOut();

        System.err.println(headshotsDir);
        String[] fileList = (String[]) headshotsDir.toArray(new String[0]);

        try
        {
            if (fileList.length == 1)
                out.write(fileList[0]);
            else
            {
                int choice = (int) (Math.random() * fileList.length);
                out.write(fileList[choice]);
            }
        }
        catch(IOException e)
        {}
        return EVAL_BODY_INCLUDE;
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

            param = new ParamElement(GraphAppletParameters.SCALE_UP,
                    graphConfig.isScaleUp());
            applet.addChildElement(param);
        }

        final JspWriter writer = pageContext.getOut();

        try {
            writer.println(applet.toString());
        } catch (IOException e) {
            throw new JspException(e);
        }
        return SKIP_BODY;
    }
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

    private void addHiddenFields()
        throws JspException{
        try {
            final ServletRequest request = pageContext.getRequest();
            final JspWriter writer = pageContext.getOut();
            String applicationId =
                    request.getParameter(RequestParams.APPLICATION_ID);
            if(applicationId != null){
                writer.println();
                writer.print(HIDDEN_FIELD_APP_ID_BEGIN);
                writer.print(applicationId);
                writer.println(HIDDEN_FIELD_END);
            }
            String objectName =
                    request.getParameter(RequestParams.OBJECT_NAME);
            if(objectName != null){
                writer.print(HIDDEN_FIELD_OBJECT_NAME_BEGIN);
                writer.print(StringUtils.htmlEscape(objectName));
                writer.println(HIDDEN_FIELD_END);
            }

        } catch (IOException e) {
            throw new JspException(e);
        }
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

        }
        results.append("</form>");
        if (this.focus != null && !this.focus.equals("")) {
            results.append(this.renderFocusJavascript());
        }
        JspWriter writer = pageContext.getOut();
        try {
            writer.print(results.toString());
        } catch (IOException e) {
            throw new JspException(messages.getMessage("common.io", e.toString()));
        }
        return (EVAL_PAGE);
    }
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

            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

Examples of javax.servlet.jsp.JspWriter

     * @param data The data to write out to the page
     * @throws JspException
     */
    public static void writeOutput(PageContext context, String data)
            throws JspException {
        JspWriter writer = context.getOut();
        try {
            writer.print(data);
        } catch (Exception e) {
            throw new JspException(
                    "Failure writing to pageContext.  Exception = " //$NON-NLS-1$
                            + e.getMessage(), e);
        }
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

    throws JspException
  {
    try {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
     
      JspWriter out = pageContext.getOut();

      TransformerFactory factory = TransformerFactory.newInstance();

      String xsltSystemId = getCanonicalURL(pageContext, _xsltSystemId);
     
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

  {
    String value = encodeURL(pageContext, _url);

    try {
      if (_var == null) {
        JspWriter out = pageContext.getOut();

        out.print(value);
      }
      else
        CoreSetTag.setValue(pageContext, _var, _scope, value);
    } catch (IOException e) {
      throw new JspException(e);
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

    throws JspException
  {
    try {
      PageContextImpl pc = (PageContextImpl) pageContext;
     
      JspWriter out = pc.getOut();

      NumberFormat format = getFormat();

      Double rawValue = null;
      BodyContentImpl body = (BodyContentImpl) getBodyContent();

      if (_hasValue)
        rawValue = _value;
      else if (body != null) {
        String value = body.getTrimString();

        if (! value.equals(""))
          rawValue = Double.parseDouble(value);
      }

      if (rawValue != null && Double.isNaN(rawValue))
        rawValue = 0.0;

      String value;

      if (rawValue == null)
        value = null;
      else if (format != null)
        value = format.format(rawValue);
      else
        value = String.valueOf(rawValue);

      if (_var == null) {
        if (_scope != null)
          throw new JspException(L.l("fmt:formatDate var must not be null when scope '{0}' is set.",
                                     _scope));

        if (value != null)
          out.print(value);
      }
      else
        CoreSetTag.setValue(pageContext, _var, _scope, value);
    } catch (IOException e) {
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.