Then the Resources are also not there yet in the SharedResources.
And static blocks are then completely evil! Because the static part:
static
{
PackageResourceReference resource = new PackageResourceReference ();
}
will pretty much fail because the class is loaded before there is an application object
becaue it is loaded by the servlet container when it is deserializing the sessions.
johan
On 2/27/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
1) is just a reference, you need to bind the object first like you do in 2)
the initializer is also needed for clustering, it is a better place to do the binding then static blocks somewhere.
javadoc from IInitializer
/**
* Initializes something when application loads
*
* Initializer is there for clustering. Lets say you access a page that has a
* link to a packaged resource on node A now the url for the resource gets
* forwarded to node B, but node B doesnt have the resource registered yet
* because maybe the page class hasn't been loaded and so its static block
* hasn't run yet. So the initializer is a place for you to register all those
* resources and do all the stuff you used to do in the static blocks.
*
-IgorOn 2/26/06, karthik Guru < [EMAIL PROTECTED]> wrote:I have done this -
1)
<wicket:head>
<script wicket:id="myscript" type="text/_javascript_" src=""></wicket:head>
add(new _javascript_Reference("myscript", MyPanel.class , "myscript.js"));
But I have seem something like this as well that goes with the above.
2)
public void init(Application application){
PackageResource.bind(application, MyPanel.class , "myscript.js");
}
What does 2) do that 1) does'nt. and when w'd i use either/or or need both?
thanks,
-- karthik --
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user