You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Bertrand Guay-Paquet (JIRA)" <ji...@apache.org> on 2012/07/03 15:33:20 UTC

[jira] [Commented] (WICKET-4636) Using setResponsePage() before page rendering should skip the rendering of the page

    [ https://issues.apache.org/jira/browse/WICKET-4636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13405918#comment-13405918 ] 

Bertrand Guay-Paquet commented on WICKET-4636:
----------------------------------------------

Quote from Martin Grigorov:
I think this is a good opportunity for an improvement! Please file a
ticket and we will investigate it.

Ajax support in Wicket works using this way: a
ListenerInterfaceRequestHandler (LIRH) is executed and
AjaxRequestHandler(/Target) (ART) is scheduled immediately and passed
to the callback function (e.g. onClick(AjaxRequestTarget)) so the user
code can use it and add components to it. Later when LIRH is ready
Wicket starts ARA which just renders whatever is already collected in
it (JavaScript and components) to <ajax-response>.

The comments in WebPageRenderer (related to WICKET-4358) also say that
a IRequestHandler can be scheduled during rendering, but I see no
reason why to render at all if there is already a scheduled
IRequestHandler before starting the rendering.
                
> Using setResponsePage() before page rendering should skip the rendering of the page
> -----------------------------------------------------------------------------------
>
>                 Key: WICKET-4636
>                 URL: https://issues.apache.org/jira/browse/WICKET-4636
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5.7
>            Reporter: Bertrand Guay-Paquet
>            Priority: Minor
>              Labels: redirect, requestcycle
>
> This ticket follows from the email thread http://markmail.org/thread/uk5y4ddoopntmkgd
> When setResponsePage() is used, the current page is still rendered. The response thus generated is then thrown away completely and a replacement request handler is used. I can think of 3 reasons why this should be avoided:
> 1-Performance; it's wasteful to render components to discard them right away
> 2-Needs complete components hierarchy; even if setResponsePage() is used in a page constructor (e.g. when redirecting depending on page parameters), since the page will be rendered, all of its components or some substitutes must be added to the page. Otherwise Wicket will throw a missing component exception in dev mode.
> 3-Feedback messages; if the needlessly rendered page contains a feedback panel, feedback messages registered in the session will be swallowed by the thrown away page rendering.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira