Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3477

Exception when setting session default timezone with GatherExtendedBrowserInfo

    XMLWordPrintableJSON

Details

    Description

      I want to set a default timezone for client sessions so I added the following line at the end of my CustomSession constructor:
      getClientInfo().getProperties().setTimeZone(TimeZone.getTimeZone("GMT"));

      Doing this coupled with getGatherExtendedBrowserInfo() == true however yields a null pointer exception.

      Some analysis:
      In WebSession#getClientInfo(), there is no clientInfo yet and getGatherExtendedBrowserInfo() is true so a redirect is attempted.
      The line "IRequestHandler activeRequestHandler = requestCycle.getActiveRequestHandler();" produces activeRequestHandler == null.
      Since there is no request handler, the following line "String url = requestCycle.urlFor(activeRequestHandler).toString();" gives a null pointer exception as urlFor returns null.

      If getGatherExtendedBrowserInfo() == false, the default timezone set in the Session constructor works fine.

      Attachments

        1. DefaultTimeZone.zip
          21 kB
          Bertrand Guay-Paquet

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            berniegp Bertrand Guay-Paquet
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: