On Fri, Feb 25, 2011 at 2:19 AM, Jeremy Thomerson <[email protected] > wrote:
> Maybe he means this line: > > On Thu, Feb 24, 2011 at 2:42 AM, Martin Grigorov <[email protected]> > wrote: > > > - final IPageManager pageManager = getSession().getPageManager(); > > > > Which in his patch, he changed to this: > > On Thu, Feb 24, 2011 at 2:42 AM, Martin Grigorov <[email protected]> > wrote: > > > + final IPageManager pageManager = getApplication().getPageManager(); > > > > If that method weren't final on Session, I would guess that is there so > that > you could potentially override the page manager on a per-session basis. > > Yes, this is what I meant. The other one looked even more weird - in Application.java we use Session.get().getAuthorizationStrategy() which returns Application.get().getAuthorizationStrategy(). But now this explanation - per-session manager/strategy - makes it more clear. Do we need to keep the "final" for Session #getPageFactory() and #getPageManager() ? > On Thu, Feb 24, 2011 at 3:13 PM, Igor Vaynberg <[email protected] > >wrote: > > > On Thu, Feb 24, 2011 at 12:42 AM, Martin Grigorov <[email protected]> > > wrote: > > > Hi, > > > > > > While working on https://issues.apache.org/jira/browse/WICKET-3477 I > > found > > > this usages of Session: > > > > > > Index: wicket-core/src/main/java/org/apache/wicket/Application.java > > > =================================================================== > > > --- wicket-core/src/main/java/org/apache/wicket/Application.java > > (revision > > > 1073297) > > > +++ wicket-core/src/main/java/org/apache/wicket/Application.java > (working > > > copy) > > > @@ -273,13 +273,14 @@ > > > { > > > final Class<? extends Component> cl = component.getClass(); > > > // If component instantiation is not authorized > > > - if > > > > (!Session.get().getAuthorizationStrategy().isInstantiationAuthorized(cl)) > > > - { > > > + if > > > > > > (!getSecuritySettings().getAuthorizationStrategy().isInstantiationAuthorized(cl)) > > > // then call any unauthorized component instantiation > > > // listener > > > getSecuritySettings().getUnauthorizedComponentInstantiationListener() > > > .onUnauthorizedInstantiation(component); > > > } > > > }); > > > } > > > Index: wicket-core/src/main/java/org/apache/wicket/Page.java > > > =================================================================== > > > --- wicket-core/src/main/java/org/apache/wicket/Page.java (revision > > 1073297) > > > +++ wicket-core/src/main/java/org/apache/wicket/Page.java (working > copy) > > > @@ -33,7 +33,6 @@ > > > import org.apache.wicket.markup.html.WebPage; > > > import org.apache.wicket.markup.resolver.IComponentResolver; > > > import org.apache.wicket.model.IModel; > > > -import org.apache.wicket.page.IManageablePage; > > > import org.apache.wicket.page.IPageManager; > > > import org.apache.wicket.pageStore.IPageStore; > > > import org.apache.wicket.request.component.IRequestablePage; > > > @@ -364,7 +360,7 @@ > > > return; > > > } > > > > > > - final IPageManager pageManager = getSession().getPageManager(); > > > + final IPageManager pageManager = getApplication().getPageManager(); > > > if (!getFlag(FLAG_IS_DIRTY) && isVersioned() && > > > pageManager.supportsVersioning()) > > > { > > > setFlag(FLAG_IS_DIRTY, true); > > > > > > > > > Is it really needed this indirection to get the Application thru the > > Session > > > ? > > > > what do you mean get application through session? > > > > -igor > > > > > > -- > Jeremy Thomerson > http://wickettraining.com > *Need a CMS for Wicket? Use Brix! http://brixcms.org* >
