I now found one way to clear all previous pages.
I guess the reason is the REDIRECT_TO_BUFFER strategy (or however it's called) which both processes a button's onClick() event AND the next page's full initialization+rendering in one request. Thus the previous page (where the button was) is marked as 'touched' in the Session as well - no matter when I clear all the pagemaps, the previous page will just be re-added at the end of the request. My current solution which solves this problem (although ugly) is the following code in the onClick:

// Make sure this page does NOT get stored at the end of the request
        getSession().untouch(getPage());
        // Clear all previous stored pages
        getSession().clear();

        // display the confirmation page
        setResponsePage(new ConfirmationPage(...));

I still hope there's a better solution but this works for now


Does anyone know if there's the possibility to override the REDIRECT_TO_BUFFER strategy for a certain redirect? This would also solve this problem as then the Session.clear() would be executed in the next request after the onClick()....

thanks

Matt

On 2011-01-25 18:14, Matthias Keller wrote:
Hi List

We've got the following scenario:
After a user hopped through a wizard, he'll reach a confirmation page in our workflow. Now the session still needs to remain active but I want to prohibit going back into the wizard and resend it again. I experimented with Session.clear() and Session.getPageMaps() and calling pageMap.remove() on each instance returned, to no avail - after clicking back, the user may still access the wizard again.

What's the correct way to 'expire' *all* previous pages so that going back using the back-button is not possible anymore? And, where do I need to put that specific code (at the end of the wizard after calling setResponsePage(), in the onInitialize() of the confirmation page, ... ?

Is there some cool debugging feature or call I'd could do to see all the pages in the pagemaps with their versions et al in order to find out what to call to clear that...?

Thank you very much

Matt


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to