Package org.apache.wicket.request.cycle

Examples of org.apache.wicket.request.cycle.RequestCycle


   * page. Prior to this, the other constructor should already have been called.
   */
  public BrowserInfoPage()
  {
    initComps();
    RequestCycle requestCycle = getRequestCycle();
    WebSession session = (WebSession)getSession();
    WebClientInfo clientInfo = session.getClientInfo();
    if (clientInfo == null)
    {
      clientInfo = new WebClientInfo(requestCycle);
View Full Code Here


      } catch (IOException iox)
      {
        throw new WicketRuntimeException(iox);
      }

      RequestCycle cycle = RequestCycle.get();
      Attributes attributes;
      if (cycle != null)
      {
        attributes = new Attributes(cycle.getRequest(), cycle.getResponse());
      }
      else
      {
        // use empty request and response in case of non-http thread. WICKET-5532
        attributes = new Attributes(new MockWebRequest(Url.parse("")), new StringResponse());
View Full Code Here

  }

  @Override
  public String getName()
  {
    RequestCycle requestCycle = RequestCycle.get();
    String name = requestCycle.getMetaData(KEY);
    if (name == null)
    {
      WebClientInfo clientInfo;
      name = getVersion2();
      if (Session.exists())
      {
        WebSession session = WebSession.get();
        clientInfo = session.getClientInfo();
      }
      else
      {
        clientInfo = new WebClientInfo(requestCycle);
      }
      ClientProperties clientProperties = clientInfo.getProperties();
      if (clientProperties.isBrowserInternetExplorer() && clientProperties.getBrowserVersionMajor() < 9)
      {
        name = getVersion1();
      }

      requestCycle.setMetaData(KEY, name);
    }
    return name;
  }
View Full Code Here

    Session session = ThreadContext.getSession();

    if (session == null)
    {
      // no session is available via ThreadContext, so lookup in session store
      RequestCycle requestCycle = RequestCycle.get();
      if (requestCycle != null)
      {
        session = Application.get().getSessionStore().lookup(requestCycle.getRequest());
        if (session != null)
        {
          ThreadContext.setSession(session);
        }
      }
View Full Code Here

    return id;
  }

  private void updateId()
  {
    RequestCycle requestCycle = RequestCycle.get();
    if (requestCycle != null)
    {
      id = getSessionStore().getSessionId(requestCycle.getRequest(), false);
    }
  }
View Full Code Here

   */
  public final Serializable getAttribute(final String name)
  {
    if (!isTemporary())
    {
      RequestCycle cycle = RequestCycle.get();
      if (cycle != null)
      {
        return getSessionStore().getAttribute(cycle.getRequest(), name);
      }
    }
    else
    {
      if (temporarySessionAttributes != null)
View Full Code Here

   */
  public final List<String> getAttributeNames()
  {
    if (!isTemporary())
    {
      RequestCycle cycle = RequestCycle.get();
      if (cycle != null)
      {
        return Collections.unmodifiableList(getSessionStore().getAttributeNames(
          cycle.getRequest()));
      }
    }
    else
    {
      if (temporarySessionAttributes != null)
View Full Code Here

   */
  public final void removeAttribute(String name)
  {
    if (!isTemporary())
    {
      RequestCycle cycle = RequestCycle.get();
      if (cycle != null)
      {
        getSessionStore().removeAttribute(cycle.getRequest(), name);
      }
    }
    else
    {
      if (temporarySessionAttributes != null)
View Full Code Here

   */
  public final void setAttribute(String name, Serializable value)
  {
    if (!isTemporary())
    {
      RequestCycle cycle = RequestCycle.get();
      if (cycle == null)
      {
        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

   
    if (parameters != null)
    {
      // store the version in the request cycle
      StringValue versionValue = parameters.get(versionParameter);
      RequestCycle requestCycle = RequestCycle.get();
      if (versionValue.isEmpty() == false && requestCycle != null)
      {
        requestCycle.setMetaData(URL_VERSION, versionValue.toString());
      }

      // undecorate
      parameters.remove(versionParameter);
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.cycle.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.