Package org.apache.wicket.protocol.http

Examples of org.apache.wicket.protocol.http.WebResponse


        TwitterSearch ts = mock(TwitterSearch.class);
        when(ts.initTwitter4JInstance("normalToken", "tSec", true)).thenReturn(ts);
        //when(ts.getCredits()).thenReturn(new Credits("normalToken", "tSec", "x", "y"));
        when(ts.getTwitterUser()).thenReturn(new Twitter4JUser("testuser"));

        WebResponse resp = mock(WebResponse.class);
        JUser user = new JUser("testuser");
        ElasticUserSearch uSearch = newMockUserSearch(user);
        MySession session = (MySession) tester.getWicketSession();
        session.setTwitterSearch(ts);
        session.setFormData("tmp@tmp.de", "test");
View Full Code Here


        TwitterSearch ts = mock(TwitterSearch.class);
        when(ts.initTwitter4JInstance("normalToken", "tSec", true)).thenReturn(ts);
        //when(ts.getCredits()).thenReturn(new Credits("normalToken", "tSec", "x", "y"));
        when(ts.getTwitterUser()).thenReturn(new Twitter4JUser("testuser"));

        WebResponse resp = mock(WebResponse.class);
        JUser user = new JUser("testuser");
        ElasticUserSearch uSearch = newMockUserSearch(user);
        MySession session = (MySession) tester.getWicketSession();
        session.setTwitterSearch(ts);
        try {
View Full Code Here

  /**
   * @see org.apache.wicket.IRequestTarget#respond(org.apache.wicket.RequestCycle)
   */
  public final void respond(final RequestCycle requestCycle)
  {
    final WebResponse response = (WebResponse)requestCycle.getResponse();

    if (markupIdToComponent.values().contains(page))
    {
      // the page itself has been added to the request target, we simply issue a redirect back
      // to the page
      final String url = requestCycle.urlFor(page).toString();
      response.redirect(url);
      return;
    }

    for (ITargetRespondListener listener : respondListeners)
    {
      listener.onTargetRespond(this);
    }

    final Application app = Application.get();

    // Determine encoding
    final String encoding = app.getRequestCycleSettings().getResponseRequestEncoding();

    // Set content type based on markup type for page
    response.setCharacterEncoding(encoding);
    response.setContentType("text/xml; charset=" + encoding);

    // Make sure it is not cached by a client
    response.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");
    response.setHeader("Cache-Control", "no-cache, must-revalidate");
    response.setHeader("Pragma", "no-cache");

    response.write("<?xml version=\"1.0\" encoding=\"");
    response.write(encoding);
    response.write("\"?>");
    response.write("<ajax-response>");

    // invoke onbeforerespond event on listeners
    fireOnBeforeRespondListeners();

    // normal behavior
    Iterator<String> it = prependJavascripts.iterator();
    while (it.hasNext())
    {
      String js = it.next();
      respondInvocation(response, js);
    }

    // process added components
    respondComponents(response);

    fireOnAfterRespondListeners(response);

    // execute the dom ready javascripts as first javascripts
    // after component replacement
    it = domReadyJavascripts.iterator();
    while (it.hasNext())
    {
      String js = it.next();
      respondInvocation(response, js);
    }
    it = appendJavascripts.iterator();
    while (it.hasNext())
    {
      String js = it.next();
      respondInvocation(response, js);
    }

    response.write("</ajax-response>");
  }
View Full Code Here

  {
    super.configureResponse();

    if (getWebRequestCycle().getResponse() instanceof WebResponse)
    {
      final WebResponse response = getWebRequestCycle().getWebResponse();
      setHeaders(response);
    }
  }
View Full Code Here

      }

      @Override
      protected WebResponse newWebResponse(final HttpServletResponse servletResponse)
      {
        return new WebResponse(servletResponse);
      }

      @Override
      protected void outputDevelopmentModeWarning()
      {
View Full Code Here

     * @see org.apache.wicket.protocol.http.WebApplication#newWebResponse(javax.servlet.http.HttpServletResponse)
     */
    @Override
    protected WebResponse newWebResponse(final HttpServletResponse servletResponse)
    {
      return new WebResponse(servletResponse);
    }
View Full Code Here

    // Determine encoding
    final String encoding = app.getRequestCycleSettings().getResponseRequestEncoding();

    // Set content type based on markup type for page
    final WebResponse response = (WebResponse)requestCycle.getResponse();
    response.setCharacterEncoding(encoding);
    response.setContentType("text/xml; charset=" + encoding);

    // Make sure it is not cached by a client
    response.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");
    response.setHeader("Cache-Control", "no-cache, must-revalidate");
    response.setHeader("Pragma", "no-cache");

    response.write("<?xml version=\"1.0\" encoding=\"");
    response.write(encoding);
    response.write("\"?>");
    response.write("<ajax-response>");

    // invoke onbeforerespond event on listeners
    fireOnBeforeRespondListeners();

    // normal behavior
    Iterator it = prependJavascripts.iterator();
    while (it.hasNext())
    {
      String js = (String)it.next();
      respondInvocation(response, js);
    }

    // process added components
    respondComponents(response);

    fireOnAfterRespondListeners(response);

    // execute the dom ready javascripts as first javascripts
    // after component replacement
    it = domReadyJavascripts.iterator();
    while (it.hasNext())
    {
      String js = (String)it.next();
      respondInvocation(response, js);
    }
    it = appendJavascripts.iterator();
    while (it.hasNext())
    {
      String js = (String)it.next();
      respondInvocation(response, js);
    }

    response.write("</ajax-response>");
  }
View Full Code Here

  {
    super.configureResponse();

    if (getWebRequestCycle().getResponse() instanceof WebResponse)
    {
      final WebResponse response = getWebRequestCycle().getWebResponse();
      setHeaders(response);
    }
  }
View Full Code Here

  {
    super.configureResponse();

    if (getWebRequestCycle().getResponse() instanceof WebResponse)
    {
      final WebResponse response = getWebRequestCycle().getWebResponse();
      setHeaders(response);
    }
  }
View Full Code Here

  /**
   * @see org.apache.wicket.IRequestTarget#respond(org.apache.wicket.RequestCycle)
   */
  public final void respond(final RequestCycle requestCycle)
  {
    final WebResponse response = (WebResponse)requestCycle.getResponse();

    if (markupIdToComponent.values().contains(page))
    {
      // the page itself has been added to the request target, we simply issue a redirect back
      // to the page
      final String url = requestCycle.urlFor(page).toString();
      response.redirect(url);
      return;
    }

    for (ITargetRespondListener listener : respondListeners)
    {
      listener.onTargetRespond(this);
    }

    final Application app = Application.get();

    // Determine encoding
    final String encoding = app.getRequestCycleSettings().getResponseRequestEncoding();

    // Set content type based on markup type for page
    response.setCharacterEncoding(encoding);
    response.setContentType("text/xml; charset=" + encoding);

    // Make sure it is not cached by a client
    response.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");
    response.setHeader("Cache-Control", "no-cache, must-revalidate");
    response.setHeader("Pragma", "no-cache");

    response.write("<?xml version=\"1.0\" encoding=\"");
    response.write(encoding);
    response.write("\"?>");
    response.write("<ajax-response>");

    // invoke onbeforerespond event on listeners
    fireOnBeforeRespondListeners();

    // normal behavior
    Iterator<String> it = prependJavascripts.iterator();
    while (it.hasNext())
    {
      String js = it.next();
      respondInvocation(response, js);
    }

    // process added components
    respondComponents(response);

    fireOnAfterRespondListeners(response);

    // execute the dom ready javascripts as first javascripts
    // after component replacement
    it = domReadyJavascripts.iterator();
    while (it.hasNext())
    {
      String js = it.next();
      respondInvocation(response, js);
    }
    it = appendJavascripts.iterator();
    while (it.hasNext())
    {
      String js = it.next();
      respondInvocation(response, js);
    }

    response.write("</ajax-response>");
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.protocol.http.WebResponse

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.