On 2011-01-26 15:49, Martijn Dashorst wrote:
On Wed, Jan 26, 2011 at 3:23 PM, Matthias Keller <[email protected]> wrote:My current solution which solves this problem (although ugly) is the following code in the onClick:You could try to see if "setRedirect(true);" works for you, and not perform a setResponsePage( new Page()), but rather do a setResponsePage(Page.class). However, that would make the confirmation page bookmarkable, something you probably don't want :)Ugly use case sometimes requires ugly code :-).. I don't think this is ugly, it performs each step you need explicitly. The use case to remove pages from the page map is not that common, so the story for doing that is not as nice. Perhaps something like a "@DontStoreInPageMap" annotation could be used. This would put the page in the session, ensuring you still have the stateful programming model and are able to work with the page as if it were a normal wicket page. But the page would not be put in the pagestore. I guess this would still work across clusters to support failover: the current page would still be stored in the session, making it available on all buddy nodes. Martijn
Hi Marijn Thanks for your replyWell, if the code's ugly or not is one side - the time required to get to that point is the other side - I spent hours trying to figure out why Session.clear() apparently does not work. To understand that, a lot of insight into Request Cycles, PageMaps and Render Strategies is necessary. I'd very much welcome a hook to alter the render strategy just for the next page. setRedirect(true) does not change the strategy and is the default in the (default) REDIRECT_TO_BUFFER strategy: In this case the next page is rendered and stored, then the user is redirected to a new url (to solve the Reload-after-POST problem) - the new url only serves the previously cached HTML code and does not call any hooks on the page itself (because it doesn't even know about it, I guess). So what I'd need would be a kind of setRedirect() which switches to REDIRECT_TO_RENDER.
Matt
smime.p7s
Description: S/MIME Cryptographic Signature
