Package org.apache.myfaces.trinidadinternal.renderkit.core.ppr

Examples of org.apache.myfaces.trinidadinternal.renderkit.core.ppr.XmlResponseWriter


      httpResponse.setHeader("Cache-Control", "no-cache");
      httpResponse.setHeader("Pragma", "no-cache");
      httpResponse.setHeader("Expires", "-1");
    }
   
    XmlResponseWriter xrw = new XmlResponseWriter(writer, "utf-8");
    xrw.startDocument();
   
    xrw.startElement("partial-response", null);
    xrw.startElement("noop", null);
    xrw.endElement("noop");     
    xrw.endElement("partial-response");

    xrw.endDocument();
    xrw.close();
  }
View Full Code Here


  @Override
  public void sendError(final int sc, final String string) throws IOException
  {
    PrintWriter writer = getWriter();
    XmlResponseWriter rw = new XmlResponseWriter(writer, "UTF-8");
    rw.startDocument();
    rw.startElement("error", null);
    rw.writeAttribute("status", sc, null);
    rw.writeText(string, null);
    rw.endElement("error");
    rw.endDocument();
    rw.close();   
  }
View Full Code Here

   * Sends a <redirect> element to the server
   */
  public static void sendXmlRedirect(final PrintWriter writer, final String url)
    throws IOException
  {
    XmlResponseWriter rw = new XmlResponseWriter(writer, "UTF-8");
    rw.startDocument();
    rw.startElement("partial-response", null);
    rw.startElement("redirect", null);
    rw.writeAttribute("url", url, null);
    rw.endElement("redirect");
    rw.endElement("partial-response");
    rw.endDocument();
    rw.close();
  }
View Full Code Here

    String error = _getErrorString();
    _LOG.severe(error, t);

    ServletResponse response = (ServletResponse)ec.getResponse();
    PrintWriter writer = response.getWriter();
    XmlResponseWriter rw = new XmlResponseWriter(writer, "UTF-8");
    rw.startDocument();
    rw.startElement("partial-response", null);
    rw.startElement("error", null);
    rw.startElement("error-name", null);
    rw.writeText(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, null);
    rw.endElement("error-name");
    rw.startElement("error-message", null);
    rw.writeText(_getExceptionString(t) + _PLEASE_SEE_ERROR_LOG + error, null);
    rw.endElement("error-message");
    rw.endElement("error");
    rw.endElement("partial-response");
    rw.endDocument();
    rw.close();
  }
View Full Code Here

  @Override
  public void sendError(final int sc, final String string) throws IOException
  {
    PrintWriter writer = getWriter();
    XmlResponseWriter rw = new XmlResponseWriter(writer, "UTF-8");
    rw.startDocument();
    rw.startElement("error", null);
    rw.writeAttribute("status", sc, null);
    rw.writeText(string, null);
    rw.endElement("error");
    rw.endDocument();
    rw.close();   
  }
View Full Code Here

      {
        responseWriter = kit.createResponseWriter(out, "text/xml", encoding);
      }
      else
      {
        responseWriter = new XmlResponseWriter(out, encoding);
      }

      return new PartialResponseWriter(responseWriter);
    }
View Full Code Here

   * Sends a <redirect> element to the server
   */
  public static void sendXmlRedirect(final PrintWriter writer, final String url)
    throws IOException
  {
    XmlResponseWriter rw = new XmlResponseWriter(writer, "UTF-8");
    rw.startDocument();
    // Add another PI indicating that this is a rich response
    // FIXME: this code is duplicated in PPRResponseWriter - fix that
    rw.write("<?Tr-XHR-Response-Type ?>\n");
    rw.startElement("redirect", null);
    rw.writeText(url, null);
    rw.endElement("redirect");
    rw.endDocument();
    rw.close();
  }
View Full Code Here

    String error = _getErrorString();
    _LOG.severe(error, t);

    ServletResponse response = (ServletResponse)ec.getResponse();
    PrintWriter writer = response.getWriter();
    XmlResponseWriter rw = new XmlResponseWriter(writer, "UTF-8");
    rw.startDocument();
    // Add another PI indicating that this is a rich response
    // FIXME: this code is duplicated in PPRResponseWriter - fix that
    rw.write("<?Tr-XHR-Response-Type ?>\n");
    rw.startElement("error", null);
    rw.writeAttribute("status", HttpServletResponse.SC_INTERNAL_SERVER_ERROR, null);
    rw.writeText(_getExceptionString(t) + _PLEASE_SEE_ERROR_LOG + error, null);
    rw.endElement("error");
    rw.endDocument();
    rw.close();
  }
View Full Code Here

      httpResponse.setHeader("Cache-Control", "no-cache");
      httpResponse.setHeader("Pragma", "no-cache");
      httpResponse.setHeader("Expires", "-1");
    }
   
    XmlResponseWriter xrw = new XmlResponseWriter(writer, "utf-8");
    xrw.startDocument();
   
    xrw.startElement("partial-response", null);
    xrw.startElement("noop", null);
    xrw.endElement("noop");     
    xrw.endElement("partial-response");

    xrw.endDocument();
    xrw.close();
  }
View Full Code Here

   * Sends a <redirect> element to the server
   */
  public static void sendXmlRedirect(final PrintWriter writer, final String url)
    throws IOException
  {
    XmlResponseWriter rw = new XmlResponseWriter(writer, "UTF-8");
    rw.startDocument();
    rw.startElement("partial-response", null);
    rw.startElement("redirect", null);
    rw.writeAttribute("url", url, null);
    rw.endElement("redirect");
    rw.endElement("partial-response");
    rw.endDocument();
    rw.close();
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.renderkit.core.ppr.XmlResponseWriter

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.