Package org.apache.wicket.request

Examples of org.apache.wicket.request.Request


  private boolean isAjax(RequestCycle requestCycle)
  {
    boolean isAjax = false;

    Request request = requestCycle.getRequest();
    if (request instanceof WebRequest)
    {
      WebRequest webRequest = (WebRequest)request;
      isAjax = webRequest.isAjax();
    }
View Full Code Here


    String urlWoJSessionId = Strings.stripJSessionId(url);
    Url resolved = new Url(getRequest().getUrl());
    resolved.resolveRelative(Url.parse(urlWoJSessionId));

    IRequestMapper mapper = getApplication().getRootRequestMapper();
    Request request = getRequest().cloneWithUrl(resolved);
    IRequestHandler handler = mapper.mapRequest(request);

    if (handler != null)
    {
      getRequestCycle().scheduleRequestHandlerAfterCurrent(handler);
View Full Code Here

   * Prevents page from get dirt inside an AJAX request.
   */
  @Override
  public final void dirty(boolean isInitialization)
  {
    Request request = getRequest();
    if (isInitialization == false && request instanceof WebRequest &&
      ((WebRequest)request).isAjax())
    {
      return;
    }
View Full Code Here

  @Override
  public void unmount(String path)
  {
    final Url url = Url.parse(path);
    final Request request = createRequest(url);

    for (IRequestMapper mapper : this)
    {
      if (mapper.mapRequest(request) != null)
      {
View Full Code Here

    return mappers.size();
  }

  Request createRequest(final Url url)
  {
    return new Request()
    {
      @Override
      public Url getUrl()
      {
        return url;
View Full Code Here

    {
      return;
    }

    ISessionStore store = getSessionStore();
    Request request = RequestCycle.get().getRequest();
    if (store.lookup(request) == null)
    {
      // explicitly create a session
      id = store.getSessionId(request, true);
      // bind it
View Full Code Here

   */
  public void internalDetach()
  {
    if (dirty)
    {
      Request request = RequestCycle.get().getRequest();
      getSessionStore().flushSession(request, this);
    }
    dirty = false;
  }
View Full Code Here

        throw new IllegalStateException(
          "Cannot set the attribute: no RequestCycle available.  If you get this error when using WicketTester.startPage(Page), make sure to call WicketTester.createRequestCycle() beforehand.");
      }

      ISessionStore store = getSessionStore();
      Request request = cycle.getRequest();

      // extra check on session binding event
      if (value == this)
      {
        Object current = store.getAttribute(request, name);
View Full Code Here

      @Override
      protected void onEvent(final AjaxRequestTarget target)
      {
        // Get clicked cursor position
        final Request request = RequestCycle.get().getRequest();
        final int x = request.getRequestParameters().getParameterValue("x").toInt(0);
        final int y = request.getRequestParameters().getParameterValue("y").toInt(0);

        // Force refresh
        imageResource.clearData();

        // Find any animal at the clicked location
View Full Code Here

        };

        RequestCycle requestCycle = mock(RequestCycle.class);
        when(requestCycle.urlFor(any(IRequestHandler.class))).thenReturn(RESOURCE_NAME);

        Request request = mock(Request.class);
        when(request.getCharset()).thenReturn(Charset.defaultCharset());
        when(requestCycle.getRequest()).thenReturn(request);

        UrlRenderer urlRenderer = mock(UrlRenderer.class);
        when(urlRenderer.renderContextRelativeUrl((any(String.class)))).thenReturn(RESOURCE_NAME);
        when(requestCycle.getUrlRenderer()).thenReturn(urlRenderer);
View Full Code Here

TOP

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

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.