Package org.apache.wicket

Examples of org.apache.wicket.Response


        {
          // TODO Performance: I haven't found a more efficient
          // solution yet.
          // Already added but all the components in this header part
          // must be touched (that they are rendered)
          Response response = container.getRequestCycle().getResponse();
          try
          {
            container.getRequestCycle().setResponse(NullResponse.getInstance());
            htmlContainer.autoAdd(headerPart);
          }
View Full Code Here


  /**
   * Constructor
   */
  public AjaxRequestTarget()
  {
    Response response = RequestCycle.get().getResponse();
    encodingBodyResponse = new AjaxResponse(response);
    encodingHeaderResponse = new AjaxResponse(response);
  }
View Full Code Here

    component.setOutputMarkupId(true);

    // substitute our encoding response for the real one so we can capture
    // component's markup in a manner safe for transport inside CDATA block
    final Response originalResponse = response;
    encodingBodyResponse.reset();
    RequestCycle.get().setResponse(encodingBodyResponse);

    // Initialize temporary variables
    final Page page = component.getPage();
View Full Code Here

    {
      component.getPage().add(header);
    }

    // save old response, set new
    Response oldResponse = RequestCycle.get().setResponse(encodingHeaderResponse);

    encodingHeaderResponse.reset();

    // render the head of component and all it's children
View Full Code Here

  protected final void onComponentRendered()
  {
    if (getComponent() instanceof AbstractTextComponent)
    {
      Response response = getComponent().getResponse();
      final String id = getComponent().getMarkupId();
      response.write(JavascriptUtils.SCRIPT_OPEN_TAG);
      response.write("new Wicket.ChangeHandler('" + id + "');");
      response.write(JavascriptUtils.SCRIPT_CLOSE_TAG);
    }
  }
View Full Code Here

      RequestCycle.get().getResponse().write("</td>");
    }

    public void renderBefore(Component component)
    {
      Response response = RequestCycle.get().getResponse();
      TreeNode parent = node.getParent();

      CharSequence classes[] = new CharSequence[level];
      for (int i = 0; i < level; ++i)
      {
        if (isNodeLast(parent))
        {
          classes[i] = "spacer";
        }
        else
        {
          classes[i] = "line";
        }

        parent = parent.getParent();
      }

      for (int i = level - 1; i >= 0; --i)
      {
        response.write("<td class=\"" + classes[i] + "\"><span></span></td>");
      }

      if (isNodeLast(node))
      {
        response.write("<td class=\"half-line\">");
      }
      else
      {
        response.write("<td class=\"line\">");
      }
    }
View Full Code Here

   * @see org.apache.wicket.IRequestTarget#respond(org.apache.wicket.RequestCycle)
   */
  public void respond(RequestCycle requestCycle)
  {
    // Get servlet response to use when responding with resource
    final Response response = requestCycle.getResponse();
    final StringBufferResourceStream stream = new StringBufferResourceStream();
    stream.append(string);

    // Respond with resource
    try
    {
      final OutputStream out = response.getOutputStream();
      try
      {
        Streams.copy(stream.getInputStream(), out);
      }
      finally
View Full Code Here

  /**
   * @see org.apache.wicket.IRequestTarget#respond(org.apache.wicket.RequestCycle)
   */
  public void respond(RequestCycle requestCycle)
  {
    Response response = requestCycle.getResponse();
    response.reset();
    if (redirectUrl.startsWith("/"))
    {
      response.redirect(RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot() + redirectUrl.substring(1))
    }
    else if (redirectUrl.startsWith("http://") || redirectUrl.startsWith("https://"))
    {
      response.redirect(redirectUrl);
    }
    else
    {
      response.redirect(RequestCycle.get().getRequest().getRelativePathPrefixToWicketHandler() + redirectUrl);
    }
  }
View Full Code Here

       * @see org.apache.wicket.MarkupContainer#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
       *      org.apache.wicket.markup.ComponentTag)
       */
      protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
      {
        Response response = RequestCycle.get().getResponse();
        TreeNode parent = node.getParent();

        CharSequence urls[] = new CharSequence[level];
        for (int i = 0; i < level; ++i)
        {
          if (isNodeLast(parent))
          {
            urls[i] = "indent-blank";
          }
          else
          {
            urls[i] = "indent-line";
          }

          parent = parent.getParent();
        }

        for (int i = level - 1; i >= 0; --i)
        {
          response.write("<span class=\"" + urls[i] + "\"></span>");
        }
      }
    };
    result.setRenderBodyOnly(true);
    return result;
View Full Code Here

          cssClassInner = "corner";
        }

        final String cssClassOuter = isNodeLast(node) ? "junction-last" : "junction";

        Response response = RequestCycle.get().getResponse();
        response.write("<span class=\"" + cssClassOuter + "\"><span class=\""
            + cssClassInner + "\"></span></span>");
      }
    }.setRenderBodyOnly(true);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.Response

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.