thanks for your help, serkan.
cool, this works. as a workaround nevertheless:
-i wouldn't want my app to check every single request the existence of
a parameter which i am going to use in only *one* page anyway
-what if i have this param passed to another page that doesn't expect
it? this could easily introduce new bugs
isn't there another easy way to force reloading / not "caching" a
page? why isn't setHeaders having any effect? should be
straightforward - what am i missing here?
thanks again anyone for some pointers!
francisco
On Mon, Oct 6, 2008 at 5:58 PM, Serkan Camurcuoglu
<[EMAIL PROTECTED]> wrote:
> If I understood you correctly, I've done something like this to show a
> different page depending on a url parameter. You should override the
> newRequestCycleProcessor() method of your application class, and return a
> different request target from the resolve method. Here I return a
> bookmarkablepagerequesttarget which creates a new home page if a certain
> parameter exists in the request:
>
> @Override
> protected IRequestCycleProcessor newRequestCycleProcessor() {
> return new WebRequestCycleProcessor() {
> @Override
> public IRequestTarget resolve(RequestCycle cycle,
> RequestParameters params) {
> if (null !=
> params.getParameters().get(ContentSearchPage.PARAM_SEARCH_KEY)) {
> return new
> BookmarkablePageRequestTarget(ContentSearchPage.class);
> }
> return super.resolve(cycle, params);
> }
> };
> }
>
>
>
> -----Original Message-----
> From: francisco treacy [mailto:[EMAIL PROTECTED]
> Sent: Mon 10/6/2008 10:07 PM
> To: [email protected]
> Subject: force page reload
>
> hi,
>
> i'm integrating a wicket application with an online payment system
> provided by a bank.
>
> i have a wicket stateful page (ie shows visa / mastercard icons) which
> links to the bank app's payment page. depending on the transaction,
> the bank sends us back a result code in an encrypted http url
> parameter, appended to the url of our wicket page.
>
> String encrypted =
> getWebRequestCycle().getWebRequest().getHttpServletRequest().getParameter("DATA");
>
> according to the bank's response, i decide whether to show a "please
> pay" or a "thank you" page with wicket variations.
>
> the only problem i am having here is: the wicket page is cached, so no
> matter what the result is, it will show the last seen version in the
> pagemap - that is, it won't re-execute the page's java code.
>
> i tried overriding headers
>
> protected void setHeaders(WebResponse response) {
> response.setHeader("Pragma", "no-cache");
> response.setDateHeader("Expires",0);
> response.setHeader("Cache-Control", "no-cache, max-age=0,
> must-revalidate, no-store");
> }
>
> but none of these http headers are seen in the html output whatsoever.
>
> i also tried implementing IMarkupCacheKeyProvider and returning null.
> with no success so far.
>
> what should i do to execute the page's code, no matter when it is called?
>
> thanks,
>
> francisco
>
> ---------------------------------------------------------------------
> 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]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]