Package org.apache.wicket.protocol.http

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


    final String id = getRequestParameters().getBehaviorId();
    if (id == null)
    {
      // wicket-2107
      throw new PageExpiredException(
        "Parameter behaviorId was not provided: unable to locate listener. Component: " +
          component.toString());
    }


    final int idAsInt = Integer.parseInt(id);
    final List<IBehavior> behaviors = component.getBehaviorsRawList();
    if (behaviors == null)
    {
      throw new PageExpiredException("No behaviors attached to component " +
        component.toString());
    }

    IBehaviorListener behaviorListener = null;

    if (behaviors.size() > idAsInt)
    {
      IBehavior behavior = behaviors.get(idAsInt);
      if (behavior instanceof IBehaviorListener)
      {

        if (!behavior.isEnabled(component))
        {
          // ignore this request
          logger.warn(
            "behavior not enabled; ignoring call. behavior: {} at index: {} on component: {}",
            new Object[] { behavior, idAsInt, component });
          if (requestCycle.getRequest() instanceof WebRequest &&
            ((WebRequest)requestCycle.getRequest()).isAjax())
          {
            throw new AbortException();
          }
          return;
        }

        behaviorListener = (IBehaviorListener)behavior;
      }
    }

    if (behaviorListener == null)
    {
      // wicket-2107
      throw new PageExpiredException("No behavior listener found with behaviorId " + id +
        "; Component: " + component.toString());
    }

    if (!component.isVisibleInHierarchy() ||
      (!(behaviorListener instanceof IIgnoreDisabledComponentBehavior) && !component.isEnabledInHierarchy()))
View Full Code Here


    PageProvider provider = new PageProvider(pageInfo.getPageId(), pageClass, pageParameters,
      renderCount);
    provider.setPageSource(getContext());
    if (provider.isNewPageInstance() && !getRecreateMountedPagesAfterExpiry())
    {
      throw new PageExpiredException(String.format("Bookmarkable page id '%d' has expired.",
        pageInfo.getPageId()));
    }
    else
    {
      return new RenderPageRequestHandler(provider);
View Full Code Here

   */
  protected IRequestTarget handleExpiredPage(final String pageMapName,
    final Class<? extends Page> pageClass, final int trailingSlashesCount,
    final boolean redirect)
  {
    throw new PageExpiredException(
      "Request cannot be processed. The target page does not exist anymore.");
  }
View Full Code Here

   
    Component component = container
        .visitChildren(new MarkupIdVisitor(id));

    if (component == null) {
      throw new PageExpiredException("No component with markup id " + id);
    }

    return component;
  }
View Full Code Here

      }
    }
    else
    {
      // Page could not be located in the session
      throw new PageExpiredException("Cannot find the rendered page in session [pagemap="
          + requestParameters.getPageMapName() + ",componentPath=" + componentPath
          + ",versionNumber=" + requestParameters.getVersionNumber() + "]");
    }
  }
View Full Code Here

      }
    }

    if (page == null)
    {
      throw new PageExpiredException(
        "Request cannot be processed. The target page does not exist anymore.");
    }

    final String pageRelativeComponentPath = Strings.afterFirstPathComponent(componentPath,
      Component.PATH_SEPARATOR);
View Full Code Here

   * @return request target used to handle this situation
   */
  protected IRequestTarget handleExpiredPage(String pageMapName, Class pageClass,
    int trailingSlashesCount, boolean redirect)
  {
    throw new PageExpiredException(
      "Request cannot be processed. The target page does not exist anymore.");
  }
View Full Code Here

   * @deprecated Use {@link #onError(Exception, String)}
   */
  @Deprecated
  protected String onError(final Exception ex)
  {
    throw new PageExpiredException("Invalid URL");
  }
View Full Code Here

    final Component component = getTarget();
    final String id = getRequestParameters().getBehaviorId();
    if (id == null)
    {
      // wicket-2107
      throw new PageExpiredException(
        "Parameter behaviorId was not provided: unable to locate listener. Component: " +
          component.toString());
    }

    final int idAsInt = Integer.parseInt(id);
    final List<IBehavior> behaviors = component.getBehaviorsRawList();
    if (behaviors == null)
    {
      throw new PageExpiredException("No behaviors attached to component " +
        component.toString());
    }

    IBehaviorListener behaviorListener = null;

    if (behaviors.size() > idAsInt)
    {
      IBehavior behavior = behaviors.get(idAsInt);
      if (behavior instanceof IBehaviorListener)
      {
        behaviorListener = (IBehaviorListener)behavior;
      }
    }

    if (behaviorListener == null)
    {
      // wicket-2107
      throw new PageExpiredException("No behavior listener found with behaviorId " + id +
        "; Component: " + component.toString());
    }

    // Invoke the interface method
    behaviorListener.onRequest();
View Full Code Here

   * @deprecated Use {@link #onError(Exception, String)}
   */
  @Deprecated
  protected String onError(final Exception ex)
  {
    throw new PageExpiredException("Invalid URL", ex);
  }
View Full Code Here

TOP

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

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.