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

Jan Loose commented on WICKET-1905:
-----------------------------------

I need to have some one-instance-pages (e.g. home page). I need increase speed, 
bookmarkable url and solve some problems with micro-applications which are 
runnig as panel inside these pages - problem with history and many opened tabs 
in browser. But other pages use the standard cases - DiskPageStorage, 
Bookmarkable/Hybrid mounts, ...

This problem can be solved by modification of DefaultPageFactory. But this 
class has all method final (for now I create a copy). The second solution is 
override the Component#getPageFactory() and return here some special 
PageFactory, but the code is final.

And finnaly the code listed above is ugly - because the code does nothing - in 
all cases returns getApplication().getSessionSettings().getPageFactory() ....

> Component.getPageFactory() vs. Session.getPageFactory() and 
> Session.getPageFactory(Page)
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-1905
>                 URL: https://issues.apache.org/jira/browse/WICKET-1905
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M4
>            Reporter: Jan Loose
>
> I was found strange code:
> In Session:
>       public final IPageFactory getPageFactory()
>       {
>               return getApplication().getSessionSettings().getPageFactory();
>       }
>       public final IPageFactory getPageFactory(final Page page)
>       {
>               if (page != null)
>               {
>                       return page.getPageFactory();
>               }
>               return getPageFactory();
>       }
> Both method are 'final', the first gets PageFactory from SessionSettings and 
> the second uses Page#PageFactory (defined in Component) or uses the 
> Session#getPageFactory() (the first method).
> In Component:
>       /**
>        * @return The page factory for the session that this component is in
>        */
>       public final IPageFactory getPageFactory()
>       {
>               return getSession().getPageFactory();
>       }
> And again 'final' and gets the PageFactory by Session#getPageFactory() too.
> Why is there this code? I think that the final word in 
> Component#getPageFactory() should be removed (i need it:-)).
> Thx,
> H.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to