Package org.apache.wicket

Examples of org.apache.wicket.RequestCycle


  /**
   * @return the HeaderResponseContainerFilteringHeaderResponse being used in this RequestCycle
   */
  public static HeaderResponseContainerFilteringHeaderResponse get()
  {
    RequestCycle requestCycle = RequestCycle.get();
    if (requestCycle == null)
    {
      throw new IllegalStateException(
        "you can only get the HeaderResponseContainerFilteringHeaderResponse when there is a RequestCycle present");
    }
    HeaderResponseContainerFilteringHeaderResponse response = requestCycle.getMetaData(RESPONSE_KEY);
    if (response == null)
    {
      throw new IllegalStateException(
        "no HeaderResponseContainerFilteringHeaderResponse is present in the request cycle.  This may mean that you have not decorated the header response with a HeaderResponseContainerFilteringHeaderResponse.  Simply calling the HeaderResponseContainerFilteringHeaderResponse constructor sets itself on the request cycle");
    }
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

    }

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

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

   * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#respond(org.apache.wicket.ajax.AjaxRequestTarget)
   */
  @Override
  protected void respond(AjaxRequestTarget target)
  {
    final RequestCycle requestCycle = RequestCycle.get();
    final String val = requestCycle.getRequest().getParameter("q");
    onRequest(val, requestCycle);
  }
View Full Code Here

   * @param url
   *            The url which describes the component path and the interface to be called.
   */
  private void dispatchEvent(final Page page, final String url)
  {
    RequestCycle rc = RequestCycle.get();
    IRequestCycleProcessor processor = rc.getProcessor();
    final RequestParameters requestParameters = processor.getRequestCodingStrategy().decode(
      new FormDispatchRequest(rc.getRequest(), url));
    IRequestTarget rt = processor.resolve(rc, requestParameters);
    if (rt instanceof IListenerInterfaceRequestTarget)
    {
      IListenerInterfaceRequestTarget interfaceTarget = ((IListenerInterfaceRequestTarget)rt);
      interfaceTarget.getRequestListenerInterface().invoke(page, interfaceTarget.getTarget());
View Full Code Here

    totalCreatedSessions.incrementAndGet();
  }

  RequestData getCurrentRequest()
  {
    RequestCycle requestCycle = RequestCycle.get();
    RequestData rd = requestCycle.getMetaData(REQUEST_DATA);
    if (rd == null)
    {
      rd = new RequestData();
      requestCycle.setMetaData(REQUEST_DATA, rd);
      int activeCount = active.incrementAndGet();

      if (activeCount > peakActive.get())
      {
        peakActive.set(activeCount);
View Full Code Here

   *      boolean)
   */
  @Override
  public boolean matches(final String path, final boolean caseSensitive)
  {
    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

     * Show the resulting valid edit
     */
    @Override
    public final void onSubmit()
    {
      final RequestCycle cycle = getRequestCycle();
      PageParameters parameters = new PageParameters();
      final Book book = getModelObject();
      parameters.put("id", book.getId());
      cycle.setResponsePage(getPageFactory().newPage(BookDetails.class, parameters));
      cycle.setRedirect(true);
    }
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

   * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#respond(org.apache.wicket.ajax.AjaxRequestTarget)
   */
  @Override
  protected void respond(AjaxRequestTarget target)
  {
    final RequestCycle requestCycle = RequestCycle.get();
    final String val = requestCycle.getRequest().getParameter("q");
    onRequest(val, requestCycle);
  }
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.