Opening a stateful page in a new window/tab with ajax

2019-11-21 Thread mscoon
Hi all, We are using the following code inside an ajax callback to create a new page and open it in a new window. Are there any gotchas with respect to how we create MyPage and get the url for it? Is it guaranteed to be found in the user's session when the request for it comes in? void openPageIn

Application # newSession # sessionUnbound - RuntimeException

2019-11-21 Thread Francois Meillet
Hi, Any RuntimeException thrown in Application # newSession(Request request, Response response) is handled by the DefaultExceptionMapper # mapUnexpectedExceptions(Exception e, final Application application) but Any RuntimeException thrown in Application # sessionUnbound(String sessionid) is n

Re: Application # newSession # sessionUnbound - RuntimeException

2019-11-21 Thread Martin Grigorov
Hi Francois, #sessionUnbound() is called in two contexts: 1) the user clicked the Logout button - in this case the call is executed in http worker thread where there is a ThreadContext, i.e. Application.get(), Session.get() and RequestCycle.get() would work here, I think, Wicket should use the Exc

Re: Application # newSession # sessionUnbound - RuntimeException

2019-11-21 Thread Francois Meillet
thanks Martin François > Le 21 nov. 2019 à 16:37, Martin Grigorov a écrit : > > Hi Francois, > > #sessionUnbound() is called in two contexts: > 1) the user clicked the Logout button - in this case the call is executed > in http worker thread where there is a ThreadContext, i.e. > Application

Re: Application # newSession # sessionUnbound - RuntimeException

2019-11-21 Thread Sven Meier
Hi, actually #sessionUnbound() is called *on* the application instance, so the ExceptionMapper is available. But ExceptionMapper maps an exception to a requestHandler, this doesn't make sense for an exception happening on a worker thread. Hope this helps Sven On 21.11.19 16:37, Martin Gri

Re: Opening a stateful page in a new window/tab with ajax

2019-11-21 Thread Sven Meier
Hi, that's a perfectly valid usage. Have fun Sven On 21.11.19 13:44, mscoon wrote: Hi all, We are using the following code inside an ajax callback to create a new page and open it in a new window. Are there any gotchas with respect to how we create MyPage and get the url for it? Is it guaran

Re: Application # newSession # sessionUnbound - RuntimeException

2019-11-21 Thread Martin Grigorov
On Thu, Nov 21, 2019 at 6:30 PM Sven Meier wrote: > Hi, > > actually #sessionUnbound() is called *on* the application instance, so > the ExceptionMapper is available. > oh, right. silly me! > But ExceptionMapper maps an exception to a requestHandler, this doesn't > make sense for an exception

Re: Application # newSession # sessionUnbound - RuntimeException

2019-11-21 Thread Sven Meier
Yes, I mean a non-web-request thread, i.e. when the session expires as you've written. Sven On 21.11.19 17:52, Martin Grigorov wrote: On Thu, Nov 21, 2019 at 6:30 PM Sven Meier wrote: Hi, actually #sessionUnbound() is called *on* the application instance, so the ExceptionMapper is availabl

Re: Application # newSession # sessionUnbound - RuntimeException

2019-11-21 Thread Francois Meillet
WARNING [Catalina-utility-1] org.apache.catalina.core.StandardContext.backgroundProcess Exception lors du traitement d'arrière plan du gestionnaire de sessions [StandardManager[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]] java.lang.RuntimeException

Re: Application # newSession # sessionUnbound - RuntimeException

2019-11-21 Thread Sven Meier
Hi Francois, yes, that's a non-request thread. IExceptionMapper isn't a general exception handler, it is a mapper from exceptions to request handlers. Using it here does not make sense. Have fun Sven On 21.11.19 18:12, Francois Meillet wrote: WARNING [Catalina-utility-1] org.apache.catali