You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Justin Morgan (Logic Sector)" <jm...@logicsector.com> on 2007/09/12 03:16:15 UTC

How to remove a page from Wicket's back button memory?

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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: (Matej?) Re: How to remove a page from Wicket's back button memory?

Posted by Matej Knopp <ma...@gmail.com>.
It should be fixed in svn already.

https://issues.apache.org/jira/browse/WICKET-942

-Matej

On 9/12/07, Justin Morgan (Logic Sector) <jm...@logicsector.com> wrote:
> Hi Matej,
>
> > i think matej did fix that today or is fixing it
>
> Any word on whether this bug is fixed? (see stack trace below)
>
> Or should I file a JIRA issue if there's not one already?
>
> Many thanks,
>
> Justin
>
> On Sep 12, 2007, at 5:50 AM, Johan Compagner wrote:
>
> > yes thats a know bug, i think matej did fix that today or is fixing
> > it right
> > now.
> >
> > johan
> >
> > On 9/12/07, Justin Morgan (Logic Sector) <jm...@logicsector.com>
> > wrote:
> >>
> >> 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.BookmarkablePageRequestTar
> >> get
> >> .newPage(BookmarkablePageRequestTarget.java:262)
> >>          at
> >> org.apache.wicket.request.target.component.BookmarkablePageRequestTar
> >> get
> >> .getPage(BookmarkablePageRequestTarget.java:277)
> >>          at
> >> org.apache.wicket.request.target.component.BookmarkablePageRequestTar
> >> get
> >> .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.removePag
> >> e
> >> (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) <jm...@logicsector.com>
> >>> 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: users-unsubscribe@wicket.apache.org
> >>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>
> >>>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


(Matej?) Re: How to remove a page from Wicket's back button memory?

Posted by "Justin Morgan (Logic Sector)" <jm...@logicsector.com>.
Hi Matej,

> i think matej did fix that today or is fixing it

Any word on whether this bug is fixed? (see stack trace below)

Or should I file a JIRA issue if there's not one already?

Many thanks,

Justin

On Sep 12, 2007, at 5:50 AM, Johan Compagner wrote:

> yes thats a know bug, i think matej did fix that today or is fixing  
> it right
> now.
>
> johan
>
> On 9/12/07, Justin Morgan (Logic Sector) <jm...@logicsector.com>  
> wrote:
>>
>> 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.BookmarkablePageRequestTar 
>> get
>> .newPage(BookmarkablePageRequestTarget.java:262)
>>          at
>> org.apache.wicket.request.target.component.BookmarkablePageRequestTar 
>> get
>> .getPage(BookmarkablePageRequestTarget.java:277)
>>          at
>> org.apache.wicket.request.target.component.BookmarkablePageRequestTar 
>> get
>> .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.removePag 
>> e
>> (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) <jm...@logicsector.com>
>>> 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: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>


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


Re: How to remove a page from Wicket's back button memory?

Posted by Johan Compagner <jc...@gmail.com>.
yes thats a know bug, i think matej did fix that today or is fixing it right
now.

johan

On 9/12/07, Justin Morgan (Logic Sector) <jm...@logicsector.com> wrote:
>
> 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) <jm...@logicsector.com>
> > 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: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to remove a page from Wicket's back button memory?

Posted by "Justin Morgan (Logic Sector)" <jm...@logicsector.com>.
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) <jm...@logicsector.com>  
> 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: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>


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


Re: How to remove a page from Wicket's back button memory?

Posted by Johan Compagner <jc...@gmail.com>.
page.getPageMap().remove(page)

johan


On 9/12/07, Justin Morgan (Logic Sector) <jm...@logicsector.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to remove a page from Wicket's back button memory?

Posted by "Justin Morgan (Logic Sector)" <jm...@logicsector.com>.
> throw RestartResponseException(main page).

I forgot to mention that the user might not always be clicking a link  
on the "main" page to access a secured page.  There are other  
unsecured pages with links to the secured pages.  So rather than  
always divert the user back to the main page with a  
restartresponseexception, I'd rather bring the user back to where  
they actually started from (main page or other page).

Cheers,

Justin

On Sep 12, 2007, at 12:57 AM, Martijn Dashorst wrote:

> Short answer: you don't.
>
> Longer answer: you still don't, but check in your event handler, or in
> possibly your page's onAttach if the request is allowed. If not, throw
> RestartResponseException(main page).
>
> Martijn
>
> On 9/12/07, Justin Morgan (Logic Sector) <jm...@logicsector.com>  
> 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: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> -- 
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.0-beta3 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


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


Re: How to remove a page from Wicket's back button memory?

Posted by Martijn Dashorst <ma...@gmail.com>.
Short answer: you don't.

Longer answer: you still don't, but check in your event handler, or in
possibly your page's onAttach if the request is allowed. If not, throw
RestartResponseException(main page).

Martijn

On 9/12/07, Justin Morgan (Logic Sector) <jm...@logicsector.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

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