Package org.apache.wicket

Examples of org.apache.wicket.RequestCycle


  /**
   * @see org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy#matches(java.lang.String)
   */
  public boolean matches(String path)
  {
    RequestCycle rc = RequestCycle.get();

    // the null check is necessary, as this method is first time called from WicketFilter when
    // no RequestCycle exists yet
    if (rc != null && ((WebRequest)rc.getRequest()).isAjax())
    {
      // HybridUrlCodingStrategy doesn't make sense for ajax request
      return false;
    }

View Full Code Here



    };
    StringResourceModel model = new StringResourceModel("simple.text", page, wsDetachModel);
    tester.setupRequestAndResponse();
    RequestCycle cycle = new WebRequestCycle(tester.getApplication(),
      tester.getWicketRequest(), tester.getWicketResponse());
    model.getObject();
    Assert.assertNotNull(model.getLocalizer());
    model.detach();
  }
View Full Code Here

   * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#respond(org.apache.wicket.ajax.AjaxRequestTarget)
   */

  protected void respond(AjaxRequestTarget target)
  {
    final RequestCycle requestCycle = RequestCycle.get();
    final String val = requestCycle.getRequest().getParameter("q");
    onRequest(val, requestCycle);
  }
View Full Code Here

    if (lockedRequest.isAjax() == true)
    {
      return true;
    }

    RequestCycle currentRequestCycle = RequestCycle.get();
    WebRequest currentRequest = (WebRequest)currentRequestCycle.getRequest();

    if (currentRequest.isAjax() == false)
    {
      // if this request is not ajax, we allow it
      return true;
    }

    String lockedPageId = Strings.firstPathComponent(lockedRequest.getRequestParameters()
      .getComponentPath(), Component.PATH_SEPARATOR);
    String currentPageId = Strings.firstPathComponent(currentRequestCycle.getRequest()
      .getRequestParameters()
      .getComponentPath(), Component.PATH_SEPARATOR);

    int lockedVersion = lockedRequest.getRequestParameters().getVersionNumber();
    int currentVersion = currentRequest.getRequestParameters().getVersionNumber();
View Full Code Here

    totalCreatedSessions++;
  }

  RequestData getCurrentRequest()
  {
    RequestCycle requestCycle = RequestCycle.get();
    RequestData rd = (RequestData)requestCycle.getMetaData(REQUEST_DATA);
    if (rd == null)
    {
      rd = new RequestData();
      requestCycle.setMetaData(REQUEST_DATA, rd);
      synchronized (this)
      {
        active++;
      }
    }
View Full Code Here

   *            the <code>Class</code> of the <code>Page</code> to be checked
   * @return true if the given <code>pageClass</code> is mounted, false otherwise
   */
  private boolean isPageMounted(Class /* <? extends Page> */pageClass)
  {
    RequestCycle cycle = RequestCycle.get();
    CharSequence path = getRequestCodingStrategy().pathForTarget(
      new BookmarkablePageRequestTarget(pageClass));
    return path != null;
  }
View Full Code Here

          .getResponseRequestEncoding());

        createRequestContext(request, response);

        // Create request cycle
        final RequestCycle cycle = webApplication.newRequestCycle(request, response);

        try
        {
          // Process request
          cycle.request();

          return cycle.wasHandled();
        }
        catch (AbortException e)
        {
          // noop
        }
View Full Code Here

    }

    protected void respond(AjaxRequestTarget target)
    {
      RequestCycle requestCycle = RequestCycle.get();
      boolean save = Boolean.valueOf(requestCycle.getRequest().getParameter("save"))
        .booleanValue();

      if (save)
      {
        editor.processInput();
View Full Code Here

   * @return {@link AjaxRequestTarget} instance if current request is an Ajax request,
   *         <code>null</code> otherwise.
   */
  public static AjaxRequestTarget get()
  {
    final RequestCycle requestCycle = RequestCycle.get();
    if (requestCycle != null)
    {
      if (requestCycle.getRequestTarget() instanceof AjaxRequestTarget)
      {
        return (AjaxRequestTarget)requestCycle.getRequestTarget();
      }
    }
    return null;
  }
View Full Code Here

    /** Create a new one of these from the current request */
    public UploadResourceState()
    {

      RequestCycle rc = RequestCycle.get();
      HttpServletRequest req = ((WebRequest)rc.getRequest()).getHttpServletRequest();
      UploadInfo info = UploadWebRequest.getUploadInfo(req);

      if (info == null || info.getTotalBytes() < 1)
      {
        status = "0|0|0|0|0";
View Full Code Here

TOP

Related Classes of org.apache.wicket.RequestCycle

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.