Hi, This method is responsible to render the current page. Depending on several conditions it decides whether to write the produced markup directly in the web response or to store the markup and make a http redirect (redirect after post pattern).
Initially a page may be requested at /some/url (the initial url). During request cycle processing the application may decide to go to another page (e.g. setResponsePage(AnotherPage.class)) that is mounted at /another/url (the target url). In this case Wicket will produce the markup for AnotherPage, so it should do an http redirect to keep in sync the url in the address bar with the rendered content. Since the application may do setResponsePage() almost everywhere (e.g. in the action phase (onClick(), onSubmit()), or in the render phase (onBeforeRender(), onAfterRender())) Wicket should do this check few times. There are many more other factors which affect the decision - isAjax, configured render strategy, required redirect policy, etc. There is WebPageRendererTest that covers all (known) combinations. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Aug 4, 2014 at 3:11 PM, Yingshou Guo <[email protected]> wrote: > It's my first post here and please for give me if this is the wrong place > to ask this kind of question. It's really hard to understand what's going > on inside the saying method. Can anyone provide some more elaborated > document about this? > > I'm especially confused about the same instance method with exactly the > same parameter requestCycle.mapUrlFor being called three time: one for > targetUrl, the other for beforRenderUrl and yet a third for afterRenderUrl. > Why and how should the result of the method call be changed? Are there any > testcases for this? > > Best, > > Guo Yingshou >
