Package org.apache.wicket

Examples of org.apache.wicket.Session$PageAccessSynchronizerProvider


   * Test for WICKET-3123
   */
  @Test
  public void sessionBinding()
  {
    Session session = tester.getSession();
    assertTrue(session.isTemporary());
    session.bind();
    assertFalse(session.isTemporary());
  }
View Full Code Here


      // 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());
      }
View Full Code Here

      // should we cleanup the pagemap?
      if (deletePageMap == true)
      {
        // get the pagemap
        Session session = Session.get();
        IPageMap pageMap = session.pageMapForName(getPageMapName(), false);

        // if there is any remove it
        if (pageMap != null)
        {
          session.removePageMap(pageMap);
          deletePageMap = false;
        }
      }

      if (windowClosedCallback != null)
View Full Code Here

    ThreadContext.setApplication(app);

    app.setName(getClass().getName());
    app.initApplication();

    Session session = new WebSession(new MockWebRequest(Url.parse("/")));
    app.getSessionStore().bind(null, session);
    ThreadContext.setSession(session);

    GuiceComponentInjector injector = new GuiceComponentInjector(app, new Module()
    {
View Full Code Here

    ThreadContext.setApplication(app);

    app.setName(getClass().getName());
    app.initApplication();

    Session session = new WebSession(new MockWebRequest(Url.parse("/")));
    app.getSessionStore().bind(null, session);
    ThreadContext.setSession(session);

    GuiceComponentInjector injector = new GuiceComponentInjector(app, new Module()
    {
View Full Code Here

   * {@link org.apache.wicket.feedback.FeedbackMessages#hasMessageFor(org.apache.wicket.Component, int)}
   * .
   */
  public void testHasMessageForComponentInt()
  {
    Session session = tester.setupRequestAndResponse().getSession();
    final Page page = new TestPage_1();
    tester.startPage(page);
    page.debug("debug message");
    page.info("info message");
    page.error("error message");
    Assert.assertTrue(session.getFeedbackMessages().hasMessageFor(page, FeedbackMessage.ERROR));
  }
View Full Code Here

  /**
   * Tests the clean up of flash messages put into the session when they are rendered.
   */
  public void testSessionFeedbackMessagesCleanUp()
  {
    Session session = Session.get();
    session.info("Message");
    session.info("Not rendered");
    FeedbackMessages feedbackMessages = session.getFeedbackMessages();
    Iterator iterator = feedbackMessages.iterator();
    FeedbackMessage message = (FeedbackMessage)iterator.next();
    message.markRendered();
    feedbackMessages.clear(RENDERED_MESSAGES);
    assertEquals(1, feedbackMessages.size());
View Full Code Here

      // 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());
      }
View Full Code Here

        if (active > 0)
        {
          rd.setActiveRequest(active--);
        }
      }
      Session session = Session.get();
      String sessionId = session.getId();
      rd.setSessionId(sessionId);

      Object sessionInfo = getSessionInfo(session);
      rd.setSessionInfo(sessionInfo);

      long sizeInBytes = -1;
      if (Application.get().getRequestLoggerSettings().getRecordSessionSize())
      {
        try
        {
          sizeInBytes = session.getSizeInBytes();
        }
        catch (Exception e)
        {
          // log the error and let the request logging continue (this is what happens in
          // the
View Full Code Here

   */
  protected ClientInfo newClientInfo()
  {
    if (getApplication().getRequestCycleSettings().getGatherExtendedBrowserInfo())
    {
      Session session = getSession();
      if (session.getMetaData(BROWSER_WAS_POLLED_KEY) == null)
      {
        // we haven't done the redirect yet; record that we will be
        // doing that now and redirect
        session.setMetaData(BROWSER_WAS_POLLED_KEY, Boolean.TRUE);
        String url = "/" + getRequest().getURL();
        throw new RestartResponseException(new BrowserInfoPage(url));
      }
      // if we get here, the redirect already has been done; clear
      // the meta data entry; we don't need it any longer is the client
      // info object will be cached too
      session.setMetaData(BROWSER_WAS_POLLED_KEY, (Boolean)null);
    }
    return new WebClientInfo(this);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.Session$PageAccessSynchronizerProvider

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.