Package org.apache.wicket.request

Examples of org.apache.wicket.request.RequestParameters


   */
  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());
    }
    else
    {
      throw new WicketRuntimeException(
        "Attempt to access unknown request listener interface " +
          requestParameters.getInterfaceName());
    }
  }
View Full Code Here


    }

    url.append(Component.PATH_SEPARATOR);

    // Add behaviourId
    RequestParameters params = requestTarget.getRequestParameters();
    if (params != null && params.getBehaviorId() != null)
    {
      url.append(params.getBehaviorId());
    }
    url.append(Component.PATH_SEPARATOR);

    // Add URL depth
    if (params != null && params.getUrlDepth() != 0)
    {
      url.append(params.getUrlDepth());
    }
    if (IActivePageBehaviorListener.INTERFACE.getName().equals(rli.getName()))
    {
      url.append(url.indexOf("?") > -1 ? "&" : "?").append(
        IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME).append("=true");
View Full Code Here

  /**
   * @see org.apache.wicket.request.IRequestCodingStrategy#decode(org.apache.wicket.Request)
   */
  public final RequestParameters decode(final Request request)
  {
    final RequestParameters parameters = new RequestParameters();
    final String pathInfo = getRequestPath(request);
    parameters.setPath(pathInfo);
    parameters.setPageMapName(request.getParameter(PAGEMAP));
    addInterfaceParameters(request, parameters);
    addBookmarkablePageParameters(request, parameters);
    addResourceParameters(request, parameters);
    if (request.getParameter(IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME) != null)
    {
      parameters.setOnlyProcessIfPathActive(true);
    }

    Map<String, String[]> map = request.getParameterMap();
    Iterator<String> iterator = map.keySet().iterator();
    // remove the parameters with a wicket namepsace prefix from the paramter list
    while (iterator.hasNext())
    {
      String key = iterator.next();
      if (key.startsWith(NAME_SPACE))
      {
        iterator.remove();
      }
    }
    parameters.setParameters(map);
    parameters.setQueryString(request.getQueryString());
    return parameters;
  }
View Full Code Here

      url.append(listenerName);
    }
    url.append(Component.PATH_SEPARATOR);

    // Add behaviourId
    RequestParameters params = requestTarget.getRequestParameters();
    if (params != null && params.getBehaviorId() != null)
    {
      url.append(params.getBehaviorId());
    }
    url.append(Component.PATH_SEPARATOR);

    // Add URL depth
    if (params != null && params.getUrlDepth() != 0)
    {
      url.append(params.getUrlDepth());
    }

    if (IActivePageBehaviorListener.INTERFACE.getName().equals(listenerName))
    {
      url.append(url.indexOf("?") > -1 ? "&" : "?").append(
View Full Code Here

    if (index == -1)
    {
      throw new IllegalArgumentException("Behavior " + this +
        " was not registered with this component: " + component.toString());
    }
    RequestParameters params = new RequestParameters();
    params.setBehaviorId(String.valueOf(index));
    if (request instanceof ServletWebRequest)
    {
      ServletWebRequest swr = (ServletWebRequest)request;
      // If we're coming in with an existing depth, use it. Otherwise,
      // compute from the URL. This provides correct behavior for repeated
      // AJAX requests: If we need to generate a URL within an AJAX
      // request for another one, it needs to be at the same depth as the
      // original AJAX request.
      int urlDepth = swr.getRequestParameters().getUrlDepth();
      params.setUrlDepth(urlDepth > -1 ? urlDepth : swr.getDepthRelativeToWicketHandler());
    }

    final IRequestTarget target = new BehaviorRequestTarget(component.getPage(), component,
      listener, params);
    return encodeUrlFor(target);
View Full Code Here

   *            The parameters to pass to the resource.
   * @return The url for the shared resource
   */
  public final CharSequence urlFor(final ResourceReference resourceReference, ValueMap parameters)
  {
    RequestParameters requestParameters = new RequestParameters();
    requestParameters.setResourceKey(resourceReference.getSharedResourceKey());
    if (getApplication().getResourceSettings().getAddLastModifiedTimeToResourceReferenceUrl() &&
      !Strings.isEmpty(resourceReference.getName()))
    {
      Time time = resourceReference.lastModifiedTime();
      if (time != null)
      {
        if (parameters == null)
        {
          parameters = new ValueMap();
          parameters.put("wicket:lm", new Long(time.getMilliseconds()));
        }
      }
    }

    requestParameters.setParameters(parameters);
    return encodeUrlFor(new SharedResourceRequestTarget(requestParameters));
  }
View Full Code Here

   */
  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 ListenerInterfaceRequestTarget)
    {
      ListenerInterfaceRequestTarget interfaceTarget = ((ListenerInterfaceRequestTarget)rt);
      interfaceTarget.getRequestListenerInterface().invoke(page, interfaceTarget.getTarget());
    }
    else
    {
      throw new WicketRuntimeException(
          "Attempt to access unknown request listener interface " +
              requestParameters.getInterfaceName());
    }
  }
View Full Code Here

    {
      return null;
    }
    else
    {
      RequestParameters parameters = RequestCycle.get().getRequest().getRequestParameters();
      String oldPageMapName = parameters.getPageMapName();

      // if there is a pagemap name specified and multiwindow support is
      // on
      if (getPageMapName() != null)
      {
        // try to find out whether the pagemap already exists
        Session session = Session.get();
        if (session.pageMapForName(getPageMapName(), false) == null)
        {
          deletePageMap = true;
        }
        parameters.setPageMapName(getPageMapName());
      }
      try
      {
        Page page = pageCreator.createPage();
        return page;
      }
      finally
      {
        parameters.setPageMapName(oldPageMapName);
      }
    }
  }
View Full Code Here

  {
    final RequestCycle cycle = getRequestCycle();
    String pageMapName = null;
    if (cycle != null)
    {
      RequestParameters parameters = getRequest().getRequestParameters();
      pageMapName = parameters.getPageMapName();
    }
    final IPageMap pageMap = PageMap.forName(pageMapName);
    init(pageMap);
  }
View Full Code Here

    if (index == -1)
    {
      throw new IllegalArgumentException("Behavior " + this
          + " was not registered with this component: " + component.toString());
    }
    RequestParameters params = new RequestParameters();
    params.setBehaviorId(String.valueOf(index));
    if (request instanceof ServletWebRequest)
    {
      ServletWebRequest swr = (ServletWebRequest)request;
      // If we're coming in with an existing depth, use it. Otherwise,
      // compute from the URL. This provides correct behavior for repeated
      // AJAX requests: If we need to generate a URL within an AJAX
      // request for another one, it needs to be at the same depth as the
      // original AJAX request.
      int urlDepth = swr.getRequestParameters().getUrlDepth();
      params.setUrlDepth(urlDepth > -1 ? urlDepth : swr.getDepthRelativeToWicketHandler());
    }

    final IRequestTarget target = new BehaviorRequestTarget(component.getPage(), component,
        listener, params);
    final IRequestCodingStrategy requestCodingStrategy = getProcessor()
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.RequestParameters

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.