Examples of ResponseWriter


Examples of com.caucho.server.http.ResponseWriter

  private boolean _hasError;

  public CauchoResponseWrapper()
  {
    _os = new ServletOutputStreamImpl();
    _writer = new ResponseWriter();
   
    _originalStream = new FilterWrapperResponseStream();
  }
View Full Code Here

Examples of com.esri.gpt.control.rest.writer.ResponseWriter

   * @throws Exception
   *             if exception occurs
   */
  public void makeStatisticsWriter(StatisticsRequestContext statReqContext)
      throws Exception {
    ResponseWriter rsWriter;
    statReqContext.setResponseString(new StringBuilder());
    HttpServletResponse response = statReqContext.getResponse();
    PrintWriter writer = response.getWriter();
    StringAttributeMap attrMap = statReqContext.getStatQueryParams();
    String outputFormat = Val.chkStr(attrMap.getValue("f"));
View Full Code Here

Examples of de.bamberg.ha.api.remote.ResponseWriter

  @Override
  public void messageReceived(ChannelHandlerContext ctx, MessageEvent nettyMessageEvent)
      throws Exception {
    log.debug(nettyMessageEvent.getMessage());
    ResponseWriter responseWriter=new NettyResponseWriter(ctx.getChannel());
    de.bamberg.ha.api.remote.MessageEvent event=new de.bamberg.ha.api.remote.MessageEvent(nettyMessageEvent.getMessage(),responseWriter);
    delegateToConnector.messageReceived(event);
   
  }
View Full Code Here

Examples of javax.faces.context.ResponseWriter

    protected void commonJavascript(
        final FacesContext context,
        final UIComponent component)
        throws IOException
    {
        final ResponseWriter writer = context.getResponseWriter();
        if (this.getRequestAttribute(JS_ATTRIBUTE) == null)
        {
            this.setRequestAttribute(
                JS_ATTRIBUTE,
                JS_ATTRIBUTE);
            writer.startElement(
                "script",
                component);
            writer.writeAttribute(
                "language",
                "JavaScript",
                null);
            writer.writeAttribute(
                "src",
                getPopupResourcePath("/popup/js/popup.js"),
                null);
            writer.endElement("script");
        }
        writer.startElement(
            "input",
            null);
        writer.writeAttribute(
            "type",
            "hidden",
            null);
        writer.writeAttribute(
            "name",
            POPUP_FRAME_HIDDEN,
            null);
        writer.writeAttribute(
            "value",
            "",
            null);
        writer.endElement("input");
    }
View Full Code Here

Examples of javax.faces.context.ResponseWriter

            }

            final String formClientId = uiform.getClientId(context);

            // start differences from command link
            final ResponseWriter writer = context.getResponseWriter();
            commonJavascript(
                context,
                command);

            writer.startElement(
                "a",
                command);
            writer.writeAttribute(
                "href",
                "#",
                null);

            String form = "document.forms['" + formClientId + "']";

            StringBuffer buffer = new StringBuffer();
            buffer.append("showPopupFrame(");
            buffer.append(form);
            buffer.append(",this,event");
            buffer.append(",'");
            buffer.append(getHiddenFieldClose(
                    command,
                    context));
            buffer.append("','");
            buffer.append(command.getStyleClassFrame() == null ? "" : command.getStyleClassFrame());
            buffer.append("','");
            buffer.append(DEFAULT_STYLE);
            buffer.append(command.getStyleFrame() == null ? "" : command.getStyleFrame());
            buffer.append("',");
            buffer.append(command.getMouseHorizPos() == null ? "0" : command.getMouseHorizPos());
            buffer.append(",");
            buffer.append(command.getMouseVertPos() == null ? "0" : command.getMouseVertPos());
            buffer.append(",");
            buffer.append(command.getAbsolute() == null ? "false" : command.getAbsolute());
            buffer.append(",");
            buffer.append(command.getCenter() == null ? "false" : command.getCenter());
            buffer.append(",'");
            buffer.append(command.getHeight() == null ? "" : command.getHeight());
            buffer.append("','");
            buffer.append(command.getWidth() == null ? "" : command.getWidth());
            buffer.append("','");
            buffer.append(command.getScrolling() == null ? "auto" : command.getScrolling().toLowerCase());
            buffer.append("');");

            buffer.append(form);
            buffer.append(".target='");
            buffer.append("hiddenPopupFrameTarget");
            buffer.append("';");

            buffer.append(form);
            buffer.append(".elements['");
            buffer.append(POPUP_FRAME_HIDDEN);
            buffer.append("'].value='");
            buffer.append(getHiddenFieldOpen(
                    command,
                    context));
            buffer.append("';");

            buffer.append(form);
            buffer.append(".submit();");
            buffer.append(form);
            buffer.append(".elements['");
            buffer.append(POPUP_FRAME_HIDDEN);
            buffer.append("'].value='';");

            buffer.append(form);
            buffer.append(".target='';");

            buffer.append("return false;");

            writer.writeAttribute(
                "onclick",
                buffer.toString(),
                null);

            writer.writeAttribute(
                "id",
                command.getClientId(context),
                null);

            final String accesskey = command.getAccesskey();
            if (accesskey != null)
            {
                writer.writeAttribute(
                    "accesskey",
                    accesskey,
                    "accesskey");
            }

            final String directory = command.getDir();
            if (directory != null)
            {
                writer.writeAttribute(
                    "dir",
                    directory,
                    "dir");
            }

            final String lang = command.getLang();
            if (lang != null)
            {
                writer.writeAttribute(
                    "lang",
                    lang,
                    "lang");
            }

            final String tabindex = command.getTabindex();
            if (tabindex != null)
            {
                writer.writeAttribute(
                    "tabindex",
                    tabindex,
                    "tabindex");
            }

            final String title = command.getTitle();
            if (title != null)
            {
                writer.writeAttribute(
                    "title",
                    title,
                    "title");
            }

            final String styleClass = command.getStyleClass();
            if (styleClass != null)
            {
                writer.writeAttribute(
                    "class",
                    styleClass,
                    "styleClass");
            }

            final String style = command.getStyle();
            if (style != null)
            {
                writer.writeAttribute(
                    "style",
                    style,
                    "style");
            }

            String label = null;
            final Object value = ((UICommand)component).getValue();
            if (value != null)
            {
                label = value.toString();
            }
            if (label != null && label.length() != 0)
            {
                writer.write(label);
            }
            writer.flush();
        }
    }
View Full Code Here

Examples of javax.faces.context.ResponseWriter

        final UICommand command = (UICommand)component;

        // - only render if rendered is true
        if (command.isRendered())
        {
            final ResponseWriter writer = context.getResponseWriter();

            // - complete writing Anchor element
            writer.endElement("a");
            writer.flush();
        }
    }
View Full Code Here

Examples of javax.faces.context.ResponseWriter

                        form,
                        context,
                        form);
                    if (this.isClient())
                    {
                        final ResponseWriter writer = context.getResponseWriter();
                        this.writeScriptStart(writer);
                        this.writeValidationFunctions(
                            form,
                            writer,
                            context);
View Full Code Here

Examples of javax.faces.context.ResponseWriter

    }
    if (view == null) {
      throw new NullPointerException("Attempt to write a null state.");
    }
    StateManager stateManager = context.getApplication().getStateManager();
    ResponseWriter writer = context.getResponseWriter();

    writer.startElement("xfc:viewState", context.getViewRoot());
    writer.writeAttribute("id", javax.faces.render.ResponseStateManager.VIEW_STATE_PARAM, null);

    if (stateManager.isSavingStateInClient(context)) {
     
      if (log.isDebugEnabled()) {
        log.debug("Save state on client");     
      }
     
      GZIPOutputStream zos = null;
      ObjectOutputStream oos = null;
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      zos = new GZIPOutputStream(bos);
      oos = new ObjectOutputStream(zos);
      oos.writeObject(view.getStructure());
      oos.writeObject(view.getState());
      oos.close();
      zos.close();
      String valueToWrite = (new String(Base64.encodeBase64(bos.toByteArray()),"ISO-8859-1"));
      if (log.isTraceEnabled()) {
        log.trace("Saving on client side : " + valueToWrite);
      }
      writer.writeAttribute("value",valueToWrite, null);
    } else {
      if(log.isDebugEnabled()){
        log.debug("Save state on server")
        log.debug("VIEW_STATE_PARAM " + view.getStructure());
      }
      writer.writeAttribute("value", view.getStructure(), null);     
    }
    writer.endElement("xfc:viewState");

    String renderKitId = context.getApplication().getDefaultRenderKitId();
    if (log.isDebugEnabled()) {
      log.debug("RENDER_KIT_ID_PARAM " + renderKitId);
    }
    if (renderKitId != null && renderKitId.equals(XULRenderKit.XUL_BASIC_RENDER_KIT)) {
      writer.startElement("xfc:renderKit", context.getViewRoot());
      writer.writeAttribute("id", ResponseStateManager.RENDER_KIT_ID_PARAM, "id");
      writer.writeAttribute("value", XULRenderKit.XUL_BASIC_RENDER_KIT, "value");
      writer.endElement("xfc:renderKit");
    } else {
      log.error(BAD_RENDERKIT_ID);
      throw new FacesException(BAD_RENDERKIT_ID);
   
  }
View Full Code Here

Examples of javax.faces.context.ResponseWriter

            log.debug("attempting to obtain from cache region '" + region +"' using key: " + key);
            String cachedContent = PageFragmentCache.instance().get(region, key);
            if (cachedContent == null) {
                log.debug("rendering from scratch: " + key);
                StringWriter stringWriter = new StringWriter();
                ResponseWriter cachingResponseWriter = writer.cloneWithWriter(stringWriter);
                context.setResponseWriter(cachingResponseWriter);
                renderChildren(context, component);
                context.setResponseWriter(writer);
                String output = stringWriter.getBuffer().toString();
                writer.write(output);
View Full Code Here

Examples of javax.faces.context.ResponseWriter

                );

                log.debug("preparing include rendering for macro: " + pluginMacroWithTemplate);
                UIComponent child = findComponent( pluginMacroWithTemplate.getClientId() );
                log.debug("JSF child client identifier: " + child.getClientId(getFacesContext()));
                ResponseWriter originalResponseWriter = getFacesContext().getResponseWriter();
                StringWriter stringWriter = new StringWriter();
                ResponseWriter tempResponseWriter = originalResponseWriter
                        .cloneWithWriter(stringWriter);
                getFacesContext().setResponseWriter(tempResponseWriter);

                try {
                    log.debug("rendering template of macro: " + pluginMacroWithTemplate);
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.