Package org.apache.wicket.request.http

Examples of org.apache.wicket.request.http.WebRequest


  @Override
  public void renderHead(Component component, IHeaderResponse response)
  {
    super.renderHead(component, response);

    WebRequest request = (WebRequest) component.getRequest();

    if (!isStopped() && (!headRendered || !request.isAjax()))
    {
      headRendered = true;
      response.render(OnLoadHeaderItem.forScript(getJsTimeoutCall(updateInterval)));
    }
  }
View Full Code Here


     * @return <code>true</code> if the resource data does need to be written,
     *         <code>false</code> otherwise.
     */
    public boolean dataNeedsToBeWritten(Attributes attributes)
    {
      WebRequest request = (WebRequest)attributes.getRequest();
      Time ifModifiedSince = request.getIfModifiedSinceHeader();

      if (cacheDuration != Duration.NONE && ifModifiedSince != null && lastModified != null)
      {
        // [Last-Modified] headers have a maximum precision of one second
        // so we have to truncate the milliseconds part for a proper compare.
View Full Code Here

      // Change the request to a multipart web request so parameters are
      // parsed out correctly
      try
      {
        ServletWebRequest request = (ServletWebRequest)getRequest();
        final WebRequest multipartWebRequest = request.newMultipartWebRequest(getMaxSize(),
          getPage().getId());
        // TODO: Can't this be detected from header?
        getRequestCycle().setRequest(multipartWebRequest);
      }
      catch (final FileUploadException fux)
View Full Code Here

  {
    String key = getSaveKey(name);

    try
    {
      WebRequest webRequest = getWebRequest();
      Cookie cookie = webRequest.getCookie(key);
      if (log.isDebugEnabled())
      {
        if (cookie != null)
        {
          log.debug("Found Cookie with name=" + key + " and request URI=" +
              webRequest.getUrl().toString());
        }
        else
        {
          log.debug("Unable to find Cookie with name=" + key + " and request URI=" +
              webRequest.getUrl().toString());
        }
      }

      return cookie;
    }
View Full Code Here

      {
        servletRequest = factory.getWrapper(servletRequest);
      }
    }

    WebRequest webRequest = newWebRequest(servletRequest, filterPath);

    return webRequest;
  }
View Full Code Here

    {
      final RequestCycle cycle = RequestCycle.get();

      if (insert == false)
      {
        WebRequest request = (WebRequest)cycle.getRequest();

        String accept = request.getHeader("Accept");
        insert = ((accept == null) || (accept.indexOf(MarkupType.XML_MIME) != -1));
      }

      if (insert)
      {
View Full Code Here

      if (redirectURL == null)
      {
        // No redirect; process the request
        ThreadContext.setApplication(application);

        WebRequest webRequest = application.createWebRequest(httpServletRequest, filterPath);
        WebResponse webResponse = application.createWebResponse(webRequest,
          httpServletResponse);

        RequestCycle requestCycle = application.createRequestCycle(webRequest, webResponse);
        res = processRequestCycle(requestCycle, webResponse, httpServletRequest,
View Full Code Here

    boolean isAjax = false;

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

    return isAjax;
  }
View Full Code Here

      // Change the request to a multipart web request so parameters are
      // parsed out correctly
      try
      {
        ServletWebRequest request = (ServletWebRequest)getRequest();
        final WebRequest multipartWebRequest = request.newMultipartWebRequest(getMaxSize());
        // TODO: Can't this be detected from header?
        getRequestCycle().setRequest(multipartWebRequest);
      }
      catch (final FileUploadException fux)
      {
View Full Code Here

   * @return the markup id of the focused element in the browser
   */
  @Override
  public String getLastFocusedElementId()
  {
    WebRequest request = (WebRequest)page.getRequest();
    String id = request.getHeader("Wicket-FocusedElementId");
    return Strings.isEmpty(id) ? null : id;
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.http.WebRequest

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.