Re: [Wicket-user] What's the purpose of PackageResource.bind in IInitializer ?
It's something we probably will try to get rid of for Wicket 2.0; instead of the pessimistic, register first approach we have now, we can choose an optimistic approach which will allow disallow in a similar fashion as file filters work. Eelco On 5/10/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote: imagine this situation w/out the use of initializer you have a cluster where you do not use sticky sessions user comes to node A and requests a page. this page binds a bunch of resources that image components on this page need. browser starts to render one of these image components and makes a resource to the resource url it needs. this request now comes to node B of the cluster. on node B no one has ever accessed this page before so none of its resources have been bound yet, so now one of the images will get a 404. the initializer makes sure that all resources are bound on all nodes at startup time not at first-access time so the situation above does not occur. hope this is clear enough -Igor On 5/10/06, smallufo <[EMAIL PROTECTED]> wrote: > > Hi > > Can somebody explain the purpose of PackageResource.bind() in IInitializer ? > > I tried to remove PackageResource.bind(application , Foo.class , "bar.gif") in IInitializer > and ... keeps the following code intact in Page/Panel > add(new Image("myImage" , new PackageResourceReference(Foo.class, "bar.gif"))); > > and the whole application works fine , images correctly shown. (I am sure the IInitializer.init() is executed) > > I just get confused. What is the purpose of PackageResource.bind in IInitializer ? > In the JavaDoc , it says for some reason about sticky session or cluster ... But I am still not clear... > > If it is for the purpose of sticky session or cluster ... why do we need to duplicate some very similar code ? > > I think > PackageResource.bind(application , Foo.class , "bar.gif") > and > ...new PackageResourceReference(Foo.class, "bar.gif"))); > seems violate the DRY rule... > > > --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] What's the purpose of PackageResource.bind in IInitializer ?
also no cluster or what ever. Simple one tomcat installationThe only thing is you need to do some maintenance. So you shutdown tomcat or the webapp contextupdate it and restart it again. The shutdown did save the session to disk.. Then after restart all sessions comes in memory again. And the request comes in.But now pages are not madeĀ because the come from the session. So resources are not bound anymore.. (or yet)With an initializer that is taken care of. johanOn 5/10/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote: imagine this situation w/out the use of initializeryou have a cluster where you do not use sticky sessionsuser comes to node A and requests a page. this page binds a bunch of resources that image components on this page need. browser starts to render one of these image components and makes a resource to the resource url it needs. this request now comes to node B of the cluster. on node B no one has ever accessed this page before so none of its resources have been bound yet, so now one of the images will get a 404. the initializer makes sure that all resources are bound on all nodes at startup time not at first-access time so the situation above does not occur.hope this is clear enough -Igor On 5/10/06, smallufo <[EMAIL PROTECTED]> wrote: HiCan somebody explain the purpose of PackageResource.bind() in IInitializer ?I tried to remove PackageResource.bind(application , Foo.class , "bar.gif") in IInitializer and ... keeps the following code intact in Page/Panel add(new Image("myImage" , new PackageResourceReference(Foo.class, "bar.gif")));and the whole application works fine , images correctly shown. (I am sure the IInitializer.init() is executed) I just get confused. What is the purpose of PackageResource.bind in IInitializer ?In the JavaDoc , it says for some reason about sticky session or cluster ... But I am still not clear...If it is for the purpose of sticky session or cluster ... why do we need to duplicate some very similar code ? I think PackageResource.bind(application , Foo.class , "bar.gif") and ...new PackageResourceReference(Foo.class, "bar.gif")));seems violate the DRY rule...
Re: [Wicket-user] What's the purpose of PackageResource.bind in IInitializer ?
imagine this situation w/out the use of initializeryou have a cluster where you do not use sticky sessionsuser comes to node A and requests a page. this page binds a bunch of resources that image components on this page need. browser starts to render one of these image components and makes a resource to the resource url it needs. this request now comes to node B of the cluster. on node B no one has ever accessed this page before so none of its resources have been bound yet, so now one of the images will get a 404. the initializer makes sure that all resources are bound on all nodes at startup time not at first-access time so the situation above does not occur.hope this is clear enough-Igor On 5/10/06, smallufo <[EMAIL PROTECTED]> wrote: HiCan somebody explain the purpose of PackageResource.bind() in IInitializer ?I tried to remove PackageResource.bind(application , Foo.class , "bar.gif") in IInitializer and ... keeps the following code intact in Page/Panel add(new Image("myImage" , new PackageResourceReference(Foo.class, "bar.gif")));and the whole application works fine , images correctly shown. (I am sure the IInitializer.init() is executed) I just get confused. What is the purpose of PackageResource.bind in IInitializer ?In the JavaDoc , it says for some reason about sticky session or cluster ... But I am still not clear...If it is for the purpose of sticky session or cluster ... why do we need to duplicate some very similar code ? I think PackageResource.bind(application , Foo.class , "bar.gif") and ...new PackageResourceReference(Foo.class, "bar.gif")));seems violate the DRY rule...