Package org.apache.shale.remoting.faces

Examples of org.apache.shale.remoting.faces.ResponseFactory


     * @param items Selection items to be rendered
     */
    protected void selectItems(FacesContext context, SelectItem items[]) throws IOException {

        ResponseWriter writer =
                (new ResponseFactory()).getResponseWriter(context, "text/xml; charset=UTF-8");

        // Generate the response content
        writer.startDocument();
        writer.startElement("items", null);
        writer.write("\n");
View Full Code Here


   
    public boolean execute(Context context) throws Exception {

        ChainContext ccontext = (ChainContext) context;
        ResponseWriter writer =
            (new ResponseFactory()).getResponseWriter
                (ccontext.getFacesContext(), "text/x-plain");
        writer.writeText("This is a test.  It is only a test.\n", null);
        return false;

    }
View Full Code Here

    public void indirectStream() {

        try {
            FacesContext context = FacesContext.getCurrentInstance();
            ResponseStream stream =
              (new ResponseFactory()).getResponseStream(context, "application/x-binary");
            for (int i = 0; i < 10; i++) {
                stream.write(i);
            }
        } catch (IOException e) {
            throw new FacesException(e);
View Full Code Here

    public void indirectWriter() {

        try {
            FacesContext context = FacesContext.getCurrentInstance();
            ResponseWriter writer =
              (new ResponseFactory()).getResponseWriter(context, "text/x-plain");
            for (int i = 0; i < 10; i++) {
                writer.write('a' + i);
            }
        } catch (IOException e) {
            throw new FacesException(e);
View Full Code Here

     * @exception IOException if an input/output error occurs
     */
    protected OutputStream outputStream(FacesContext context, String contentType)
      throws IOException {

        return (new ResponseFactory()).getResponseStream(context, contentType);

    }
View Full Code Here

        mappings.setPatterns(new String[] { "*.faces" });
        mapping.setPattern("/dynamic/*");

        // Perform the link request and check the results
        facesContext.setResponseWriter
          ((new ResponseFactory()).getResponseWriter(facesContext, "text/javascript"));
        helper.linkJavascript(facesContext, new UIOutput(),
                              facesContext.getResponseWriter(),
                              Mechanism.CLASS_RESOURCE, "/foo/bar.js");

        // Evaluate the results
View Full Code Here

        mappings.setPatterns(new String[] { "/faces/*" });
        mapping.setPattern("*.dyn");

        // Perform the link request and check the results
        facesContext.setResponseWriter
          ((new ResponseFactory()).getResponseWriter(facesContext, "text/css"));
        helper.linkStylesheet(facesContext, new UIOutput(),
                              facesContext.getResponseWriter(),
                              Mechanism.CLASS_RESOURCE, "/foo/bar.css");

        // Evaluate the results
View Full Code Here

TOP

Related Classes of org.apache.shale.remoting.faces.ResponseFactory

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.