Package org.apache.wicket

Examples of org.apache.wicket.Response


            {
                locale = loc;
            }
        };
        // Get servlet response to use when responding with resource
        final Response response = getRequestCycle().getResponse();
        // set not cacheable
        response.setLastModifiedTime(Time.valueOf(-1));
        getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(resourceStream, WicketURLEncoder.QUERY_INSTANCE.encode(resourceProvider.getName())));
    }
View Full Code Here


   * @param page
   */
  public AjaxRequestTarget(Page page)
  {
    this.page = page;
    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.findParent(Page.class);
View Full Code Here

      final Page page = component.getPage();
      page.addOrReplace(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

          if ((element instanceof ComponentTag) && !markupStream.atCloseTag())
          {
            String id = ((ComponentTag)element).getId();

            // Temporarily replace the web response with a String response
            final Response webResponse = getResponse();

            try
            {
              final StringResponse response = new StringResponse();
              getRequestCycle().setResponse(response);
View Full Code Here

        {
          // 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, null);
          }
View Full Code Here

   * @see org.apache.wicket.IComponentBorder#renderBefore(org.apache.wicket.Component)
   */
  public void renderBefore(Component component)
  {
    final MarkupStream stream = getMarkupStream(component);
    final Response response = component.getResponse();
    stream.setCurrentIndex(0);

    boolean insideBorderMarkup = false;
    while (stream.hasMore())
    {
      MarkupElement e = stream.get();
      stream.next();
      if (e instanceof WicketTag)
      {
        WicketTag wt = (WicketTag)e;
        if (!insideBorderMarkup)
        {
          if (wt.isBorderTag() && wt.isOpen())
          {
            insideBorderMarkup = true;
            continue;
          }
          else
          {
            throw new WicketRuntimeException(
              "Unexpected tag encountered in markup of component border " +
                getClass().getName() + ". Tag: " + wt.toString() +
                ", expected tag: <wicket:border>");
          }
        }
        else
        {
          if (wt.isBodyTag())
          {
            break;
          }
          else
          {
            throw new WicketRuntimeException(
              "Unexpected tag encountered in markup of component border " +
                getClass().getName() + ". Tag: " + wt.toString() +
                ", expected tag: <wicket:body> or </wicket:body>");
          }
        }
      }
      if (insideBorderMarkup)
      {
        response.write(e.toCharSequence());
      }
    }

    if (!stream.hasMore())
    {
View Full Code Here

   * @see IComponentBorder#renderAfter(org.apache.wicket.Component)
   */
  public void renderAfter(Component component)
  {
    final MarkupStream stream = getMarkupStream(component);
    final Response response = component.getResponse();

    while (stream.hasMore())
    {
      MarkupElement e = stream.get();
      stream.next();
      if (e instanceof WicketTag)
      {
        WicketTag wt = (WicketTag)e;
        if (wt.isBorderTag() && wt.isClose())
        {
          break;
        }
        else
        {
          throw new WicketRuntimeException(
            "Unexpected tag encountered in markup of component border " +
              getClass().getName() + ". Tag: " + wt.toString() +
              ", expected tag: </wicket:border>");
        }
      }
      response.write(e.toCharSequence());
    }
  }
View Full Code Here

  {
    super.onRendered(component);
    // Append the span and img icon right after the rendering of the
    // component. Not as pretty as working with a panel etc, but works
    // for behaviors and is more efficient
    Response response = component.getResponse();
    response.write("\n<span class=\"yui-skin-sam\">&nbsp;<span style=\"");
    if (renderOnLoad())
    {
      response.write("display:block;");
    }
    else
    {
      response.write("display:none;");
      response.write("position:absolute;");
    }
    response.write("z-index: 99999;\" id=\"");
    response.write(getEscapedComponentMarkupId());
    response.write("Dp\"></span><img style=\"");
    response.write(getIconStyle());
    response.write("\" id=\"");
    response.write(getIconId());
    response.write("\" src=\"");
    CharSequence iconUrl = getIconUrl();
    response.write(Strings.escapeMarkup(iconUrl != null ? iconUrl.toString() : ""));
    response.write("\" alt=\"");
    CharSequence alt = getIconAltText();
    response.write(Strings.escapeMarkup((alt != null) ? alt.toString() : ""));
    response.write("\" title=\"");
    CharSequence title = getIconTitle();
    response.write(Strings.escapeMarkup((title != null) ? title.toString() : ""));
    response.write("\"/>");


    if (renderOnLoad())
    {
      response.write("<br style=\"clear:left;\"/>");
    }
    response.write("</span>");
  }
View Full Code Here

   * @param page
   */
  public AjaxRequestTarget(Page page)
  {
    this.page = page;
    Response response = RequestCycle.get().getResponse();
    encodingBodyResponse = new AjaxResponse(response);
    encodingHeaderResponse = new AjaxResponse(response);
  }
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.