Hi,

On Mon, Dec 19, 2011 at 12:18 AM, Guillaume Smet
<guillaume.s...@gmail.com> wrote:
> Hello,
>
> We are currently migrating our applications from Wicket 1.4 to 1.5.
>
> I have a problem with a pattern we use for logout, namely:
> public class LogoutPage extends WebPage {
>        public LogoutPage() {
>                AuthenticatedWebSession session = 
> AuthenticatedWebSession.get();
>                if (session != null) {

Better use Session.exists() instead of .get(), because #get() acts as
getOrCreate().

>                        session.invalidate();
>                }
>
>                
> setResponsePage(CoreWicketAuthenticatedApplication.get().getSignInPageClass());
>        }
> }
>
> In Wicket 1.4, it worked perfectly. The only change I made is that I
> had to remove the setRedirect(true) for 1.5.
>
> With 1.5, when I click on a bookmarkable link pointing to LogoutPage,
> I have the following error:
> org.apache.wicket.markup.MarkupNotFoundException: Can not determine
> Markup. Component is not yet connected to a parent. [Page class =
> fr.openwide.core.wicket.more.security.page.LogoutPage, id = 86, render
> count = 1]
>     at org.apache.wicket.Component.getMarkup(Component.java:731)
>     at org.apache.wicket.Component.internalRender(Component.java:2312)
>     at org.apache.wicket.Component.render(Component.java:2275)
>     at org.apache.wicket.Page.renderPage(Page.java:1035)
>     at 
> org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
>     at 
> org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
>     at 
> org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
>     at 
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:750)
>     at 
> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
>     at 
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:252)
>     at 
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:209)
>     at 
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
>     at 
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
>     at 
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
>
> Any idea on why it doesn't work anymore and how I can fix it?
>
> Thanks.
>
> --
> Guillaume
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to