Package org.apache.wicket.protocol.http.request

Examples of org.apache.wicket.protocol.http.request.WebClientInfo


      {
        ClientPropertiesBean propertiesBean = getModelObject();

        RequestCycle requestCycle = getRequestCycle();
        WebSession session = (WebSession)getSession();
        WebClientInfo clientInfo = session.getClientInfo();

        if (clientInfo == null)
        {
          clientInfo = new WebClientInfo(requestCycle);
          getSession().setClientInfo(clientInfo);
        }

        ClientProperties properties = clientInfo.getProperties();
        propertiesBean.merge(properties);

        afterSubmit();
      }
    };
View Full Code Here


  public BrowserInfoPage()
  {
    initComps();
    RequestCycle requestCycle = getRequestCycle();
    WebSession session = (WebSession)getSession();
    WebClientInfo clientInfo = session.getClientInfo();
    if (clientInfo == null)
    {
      clientInfo = new WebClientInfo(requestCycle);
      getSession().setClientInfo(clientInfo);
    }
    else
    {
      ClientProperties properties = clientInfo.getProperties();
      properties.setJavaEnabled(false);
    }

    continueToOriginalDestination();
  }
View Full Code Here

    Class<? extends Page> pageClass = DatesPage2.class;
    MutableDateTime dt = new MutableDateTime(DateTimeZone.forTimeZone(tzClient));
    dt.setDateTime(2010, 11, 6, 0, 0, 0, 0);
    Date date = new Date(dt.getMillis());

    WebClientInfo clientInfo = (WebClientInfo)tester.getSession().getClientInfo();
    clientInfo.getProperties().setTimeZone(tzClient);

    tester.getSession().setLocale(Locale.GERMANY);
    tester.startPage(pageClass);
    tester.assertRenderedPage(pageClass);
    FormTester formTester = tester.newFormTester("form");
View Full Code Here

    Class<? extends Page> pageClass = DatesPage2.class;
    MutableDateTime dt = new MutableDateTime(DateTimeZone.forTimeZone(tzClient));
    dt.setDateTime(2010, 11, 6, 0, 0, 0, 0);
    Date date = new Date(dt.getMillis());

    WebClientInfo clientInfo = (WebClientInfo)tester.getSession().getClientInfo();
    clientInfo.getProperties().setTimeZone(tzClient);

    tester.getSession().setLocale(Locale.GERMANY);
    tester.startPage(pageClass);
    tester.assertRenderedPage(pageClass);
    FormTester formTester = tester.newFormTester("form");
View Full Code Here

    Class<? extends Page> pageClass = DatesPage2.class;
    MutableDateTime dt = new MutableDateTime(DateTimeZone.forTimeZone(tzClient));
    dt.setDateTime(2010, 11, 6, 22, 0, 0, 0);
    Date date = new Date(dt.getMillis());

    WebClientInfo clientInfo = (WebClientInfo)tester.getSession().getClientInfo();
    clientInfo.getProperties().setTimeZone(tzClient);

    tester.getSession().setLocale(Locale.US);
    tester.startPage(pageClass);
    tester.assertRenderedPage(pageClass);
    FormTester formTester = tester.newFormTester("form");
View Full Code Here

    TimeZone tzClient = TimeZone.getTimeZone("Canada/Eastern");
    TimeZone tzServer = TimeZone.getTimeZone("GMT");

    TimeZone.setDefault(tzServer);
    DateTimeZone.setDefault(DateTimeZone.forTimeZone(tzServer));
    WebClientInfo clientInfo = (WebClientInfo)tester.getSession().getClientInfo();
    clientInfo.getProperties().setTimeZone(tzClient);
    tester.getSession().setLocale(Locale.GERMAN);

    // Test with standard time (in client time zone)
    MutableDateTime dt = new MutableDateTime(DateTimeZone.forTimeZone(tzClient));
    dt.setDateTime(2010, 1, 15, 0, 0, 0, 0);
View Full Code Here

    TimeZone tzServer = TimeZone.getTimeZone("GMT-12");

    TimeZone.setDefault(tzServer);
    DateTimeZone.setDefault(DateTimeZone.forTimeZone(tzServer));

    WebClientInfo clientInfo = (WebClientInfo)tester.getSession().getClientInfo();
    clientInfo.getProperties().setTimeZone(tzClient);

    StyleDateConverter converter = new StyleDateConverter(true);

    Calendar cal = Calendar.getInstance(tzClient);
    cal.set(2011, 10, 5, 0, 0, 0);
View Full Code Here

    TimeZone tzClient = TimeZone.getTimeZone("GMT-12");
    TimeZone tzServer = TimeZone.getTimeZone("GMT+14");

    TimeZone.setDefault(tzServer);
    DateTimeZone.setDefault(DateTimeZone.forTimeZone(tzServer));
    WebClientInfo clientInfo = (WebClientInfo)tester.getSession().getClientInfo();
    clientInfo.getProperties().setTimeZone(tzClient);

    Calendar cal = Calendar.getInstance(tzServer);
    cal.set(2011, 5, 15, 10, 30, 0);
    cal.set(Calendar.MILLISECOND, 0);
    Date date = cal.getTime();
View Full Code Here

    WebRequestCycle requestCycle = (WebRequestCycle)getRequestCycle();
    WebSession session = (WebSession)getSession();
    ClientInfo clientInfo = session.getClientInfo();
    if (clientInfo == null)
    {
      clientInfo = new WebClientInfo(requestCycle);
      getSession().setClientInfo(clientInfo);
    }
    else if (clientInfo instanceof WebClientInfo)
    {
      WebClientInfo info = (WebClientInfo)clientInfo;
      ClientProperties properties = info.getProperties();
      properties.setJavaEnabled(false);
    }
    else
    {
      warnNotUsingWebClientInfo(clientInfo);
View Full Code Here

        // 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
        setMetaData(BROWSER_WAS_POLLED_KEY, null);
      }
      clientInfo = new WebClientInfo(requestCycle);
    }
    return (WebClientInfo)clientInfo;
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.protocol.http.request.WebClientInfo

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.