Johan Compagner wrote:


I really don't see what the problem is with allowing one to pass an Application reference into StaticResource. You wrote: "In fact, a
StaticResourceReference CANNOT be static and must be
created within a request to allow the resource to bind
to the application" but this isn't really true, because if you look at the source-code, there is nothing preventing you from passing in the Application if you have a reference to it. Both StaticResource.java and StaticResourceReference.java simply make use of the Session or RequestCycle variables to get at the application, which is fine and good for ease of use, but why not add an extra constructor which allows the Application to be specified explicitly?

And what does that gain?
If you can add an applicaiton object. Then most likely you have it from the RequestCycle.

Actually, this is not true. If you wish to register a StaticResource from within a Application constructor then RequestCycle will return a null application. You have no choice but to explicitly pass in an Application. This is the only reason I can see why we can't already register StaticResources with an application scope and be able to hit them before any Page is constructed.

Yes add the all youre static/package images at for hand (in the init of youre application)
But this is not always doable i know

But you can't do that currently because StaticImage will die with a NullPointerException trying to retrieve the application from the session and/or request cycle.

Gili


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to