You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Bertrand Guay-Paquet (JIRA)" <ji...@apache.org> on 2011/02/24 15:28:38 UTC

[jira] Issue Comment Edited: (WICKET-3477) Exception when setting session default timezone with GatherExtendedBrowserInfo

    [ https://issues.apache.org/jira/browse/WICKET-3477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998861#comment-12998861 ] 

Bertrand Guay-Paquet edited comment on WICKET-3477 at 2/24/11 2:28 PM:
-----------------------------------------------------------------------

Thank you Martin for the excellent explanation.

I did not know setClientInfo() existed which allowed me to create the WebClientInfo instance myself.

Should I put that as "resolved" then?

(for the record, the only information I could find for setting default ClientInfo values was : http://apache-wicket.1842946.n4.nabble.com/Using-ClientProperties-Object-for-User-selectable-Timezone-td1846293.html)

      was (Author: berniegp):
    Thank you Martin for the excellent explanation.

I did not know setClientInfo() existed which allowed me to create the WebClientInfo instance myself.

Should I put that as "resolved" then?
  
> Exception when setting session default timezone with GatherExtendedBrowserInfo
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-3477
>                 URL: https://issues.apache.org/jira/browse/WICKET-3477
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC1
>            Reporter: Bertrand Guay-Paquet
>            Assignee: Martin Grigorov
>              Labels: nullpointerexception
>         Attachments: DefaultTimeZone.zip
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira