Thanks, I tried that but I get an exception in the Wicket 1.3 snapshot I'm using. Is there a known bug in the remove(Page) method? Or maybe I'm simply using it wrong? (after logging in, my secured page is attempting to invoke loginpage.getpagemap().remove (loginpage) in the secured page's constructor).

[01:39:54,832 ERROR org.apache.wicket.RequestCycle]: Can't instantiate page using constructor public com.logicsector.web.page.SecuredExamplePage (org.apache.wicket.PageParameters) and argument exampleId = "100" org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor public com.logicsector.web.page.SecuredExamplePage (org.apache.wicket.PageParameters) and argument exampleId = "100" at org.apache.wicket.session.DefaultPageFactory.newPage (DefaultPageFactory.java:175) at org.apache.wicket.session.DefaultPageFactory.newPage (DefaultPageFactory.java:96) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget .newPage(BookmarkablePageRequestTarget.java:262) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget .getPage(BookmarkablePageRequestTarget.java:277) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget .processEvents(BookmarkablePageRequestTarget.java:205) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents (AbstractRequestCycleProcessor.java:90) at org.apache.wicket.RequestCycle.processEventsAndRespond (RequestCycle.java:1018)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1093)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1162)
at org.apache.wicket.RequestCycle.request(RequestCycle.java: 485) at org.apache.wicket.protocol.http.WicketFilter.doGet (WicketFilter.java:261) at org.apache.wicket.protocol.http.WicketServlet.doGet (WicketServlet.java:126)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:228) at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:216) at org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.process(Http11Protocol.java:634) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run (JIoEndpoint.java:445)
        at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance (Constructor.java:494) at org.apache.wicket.session.DefaultPageFactory.newPage (DefaultPageFactory.java:154)
        ... 25 more
Caused by: java.lang.ClassCastException: java.lang.Integer
at org.apache.wicket.protocol.http.pagestore.PageWindowManager.removePage (PageWindowManager.java:544) at org.apache.wicket.protocol.http.pagestore.DiskPageStore $SessionEntry.removePage(DiskPageStore.java:252) at org.apache.wicket.protocol.http.pagestore.DiskPageStore.removePage (DiskPageStore.java:616) at org.apache.wicket.protocol.http.pagestore.DiskPageStore.removePage (DiskPageStore.java:645) at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore $SecondLevelCachePageMap.removeEntry (SecondLevelCacheSessionStore.java:368)
        at org.apache.wicket.PageMap.remove(PageMap.java:289)
at com.logicsector.web.page.SecuredExamplePage.<init> (SecuredExamplePage.java:64)
        ... 30 more


On Sep 12, 2007, at 12:59 AM, Johan Compagner wrote:

page.getPageMap().remove(page)

johan


On 9/12/07, Justin Morgan (Logic Sector) <[EMAIL PROTECTED]> wrote:

Hi,

Okay, another newbie question.  :)

I have some secured pages that require a user login.  The "main" page
(unsecured) has direct links to these secured pages.  If the user
tries to access one of these secured pages without being logged in, I
throw a restartresponseexception that takes them to the login page.
Upon login page submission they continue to the original destination
(so far so good).

However, if the user clicks the Back button they go back to the login
page (as expected).  However, if they re-enter their credentials and
submit the login page again, their "original destination" is gone, so
the login page just goes back to the login page again.  There's no
other logical place for them to go, either, so I'd like to simply
chop the login page from the Back button memory.

My question is:  How can I programmatically remove a previously-
visited page (i.e., login page) so that if the user hits the Back
button they skip that page (i.e., they go directly back to the "main"
page instead of the login page)?

Thanks for any info,

Justin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to