wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: why generate hybrid URL for stateless page?
Date Tue, 13 Sep 2011 08:10:47 GMT
Hi Kent,

Indeed the URL is hybrid but only the component info is actually used.
Since the page is stateless the page is not stored and the next
request recreates a new instance of this page class and uses the
component info (e.g. ILinkListener-form-link) to find the link and
execute its onClick method.

Maybe we can optimize this a bit by changing the page id to -1 and
don't do the lookup by page id when the link is clicked.
I.e. the generated url for components in stateless page will look
like: -1-1.ILinkListener-form-link

I'll experiment with that.

On Tue, Sep 13, 2011 at 9:00 AM, Kent Tong <kent@cpttm.org.mo> wrote:
> Hi,
>
> In 1.5 I found that even if a page is stateless, Wicket still generates
> hybrid URLs (with PageInfo) for stateless links/forms. This is done in
> AbstractBookmarkableMapper (see below). Any idea why? Thanks!
>
>
> if (requestHandler instanceof BookmarkableListenerInterfaceRequestHandler)
> {
>        // listener interface URL with page class information
>        BookmarkableListenerInterfaceRequestHandler handler =
> (BookmarkableListenerInterfaceRequestHandler)requestHandler;
>        Class<? extends IRequestablePage> pageClass = handler.getPageClass();
>        if (!checkPageClass(pageClass))
>        {
>                return null;
>        }
>        Integer renderCount = null;
>        if (handler.getListenerInterface().isIncludeRenderCount())
>        {
>                renderCount = handler.getRenderCount();
>        }
>        PageInfo pageInfo = new PageInfo(handler.getPageId());
>        ComponentInfo componentInfo = new ComponentInfo(renderCount,
>        requestListenerInterfaceToString(handler.getListenerInterface()),
>                                handler.getComponentPath(),
>                                handler.getBehaviorIndex());
>        UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(pageInfo,
> componentInfo),
>                                pageClass, handler.getPageParameters());
>        return buildUrl(urlInfo);
> }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message