The WebSocket connection is closed and a new one is opened at page reload. Check whether you have JSESSIONID cookie before reloading the page.
Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Sep 1, 2016 at 9:53 AM, Maxim Solodovnik <[email protected]> wrote: > The situation is weird and I don't know how it can be investigated > > everything works as expected in case NoVersionMapper is not used. > > If I'm using NoVersionMapper page is loaded and work as expected if loaded > via URL > But if after that I'll reload it using Shift+F5 I got continuous reloading, > URL polluting and NPE because Session is NULL. > > Maybe you can suggest how this can be debugged? > > On Thu, Sep 1, 2016 at 2:44 PM, Martin Grigorov <[email protected]> > wrote: > > > JavaxUpgradeHttpRequest is just a POJO that stores the data from the > > original upgrade request. > > WebSocket requests are not normal HTTP requests so they cannot create an > > http session. > > > > So, if there was an existing HTTP session when the WebSocket connection > is > > established then we store the data that is available at that time. > > But if there is no session at that time then this WebSocket connection > > cannot a reference to a newly created one at later point of time. > > > > Martin Grigorov > > Wicket Training and Consulting > > https://twitter.com/mtgrigorov > > > > On Thu, Sep 1, 2016 at 9:25 AM, Maxim Solodovnik <[email protected]> > > wrote: > > > > > This only happen in case I'm using NoVersion page mapper > > > > > > On Thu, Sep 1, 2016 at 2:24 PM, Maxim Solodovnik <[email protected] > > > > > wrote: > > > > > > > It works as expected with one minor change: > > > > -- Wicket.Event.WebSocket.Opened > > > > ++ Wicket.Event.Topic.WebSocket.Opened > > > > > > > > Thanks :) > > > > > > > > Another question: > > > > Why org.apache.wicket.protocol.ws.javax.JavaxUpgradeHttpRequest. > > > getSession(boolean) > > > > does not creates the session even if boolean parameter is true? > > > > I have weird behavior because of this: on Shift+F5 page continuously > > > > reloading > > > > all page parameters are duplicated in the URL until I got Bad Request > > > .... > > > > > > > > > > > > On Thu, Sep 1, 2016 at 12:56 PM, Maxim Solodovnik < > > [email protected]> > > > > wrote: > > > > > > > >> OK > > > >> Will try :) > > > >> > > > >> I had an idea like this, but hoping there is some other way :) > > > >> > > > >> On Thu, Sep 1, 2016 at 12:54 PM, Martin Grigorov < > > [email protected]> > > > >> wrote: > > > >> > > > >>> I think you should listen for the "open" message on the client side > > and > > > >>> once it comes then send a message to ask for the initial update. > > > >>> Something like: Wicket.Event.subscribe(Wicket. > > Event.WebSocket.Opened, > > > >>> function() { Wicket.WebSocket.send("initialRepaint") }) > > > >>> > > > >>> Martin Grigorov > > > >>> Wicket Training and Consulting > > > >>> https://twitter.com/mtgrigorov > > > >>> > > > >>> On Thu, Sep 1, 2016 at 7:41 AM, Maxim Solodovnik < > > [email protected] > > > > > > > >>> wrote: > > > >>> > > > >>> > It is technically possible ... but with no effect :(((( > > > >>> > What should be the steps to send component tree update on > websocket > > > >>> client > > > >>> > connect? > > > >>> > > > > >>> > On Thu, Sep 1, 2016 at 12:35 PM, Martin Grigorov < > > > [email protected] > > > >>> > > > > >>> > wrote: > > > >>> > > > > >>> > > Hi Maxim, > > > >>> > > > > > >>> > > If I remember correctly it is not yet possible to write to the > > > >>> client at > > > >>> > > that point. > > > >>> > > But I might be wrong. > > > >>> > > > > > >>> > > Martin Grigorov > > > >>> > > Wicket Training and Consulting > > > >>> > > https://twitter.com/mtgrigorov > > > >>> > > > > > >>> > > On Thu, Sep 1, 2016 at 7:11 AM, Maxim Solodovnik < > > > >>> [email protected]> > > > >>> > > wrote: > > > >>> > > > > > >>> > > > Hello, > > > >>> > > > > > > >>> > > > I wonder why we don't have WebSocketRequestHandler in > onConnect > > > >>> message > > > >>> > > > handler. > > > >>> > > > I would like to perform markup update on client connect, and > it > > > >>> seems > > > >>> > to > > > >>> > > be > > > >>> > > > impossible without copy/pasting onEvent method code > > > >>> > > > > > > >>> > > > -- > > > >>> > > > WBR > > > >>> > > > Maxim aka solomax > > > >>> > > > > > > >>> > > > > > >>> > > > > >>> > > > > >>> > > > > >>> > -- > > > >>> > WBR > > > >>> > Maxim aka solomax > > > >>> > > > > >>> > > > >> > > > >> > > > >> > > > >> -- > > > >> WBR > > > >> Maxim aka solomax > > > >> > > > > > > > > > > > > > > > > -- > > > > WBR > > > > Maxim aka solomax > > > > > > > > > > > > > > > > -- > > > WBR > > > Maxim aka solomax > > > > > > > > > -- > WBR > Maxim aka solomax >
