I don't necessarily think this is a bad thing. I think it is more consistent than we use Class for the scope all across Wicket and simply modify the Javadoc to mention that the path argument is specified relative to the package of the scope.

Gili

Johan Compagner wrote:
looked at the code and i don;t think this will work:

private PackageResource(final Package basePackage, final String path, final Locale locale,
           final String style)
   {
       packageClass = basePackage.getClass();

and use that packageClass later on:

this.resourceStream = Application.get().getResourceStreamLocator().locate( packageClass.getClassLoader(), absolutePath, style, locale, null);

Because the class that is used there is the the Package.class (the one of the system classpath)

its a pitty that this: ClassLoader.getCallerClassLoader() is hidden from use to call..

or else we could do:

private PackageResource(final Package basePackage, final String path, final Locale locale,
           final String style)
   {
       packageClass = ClassLoader.getCallerClassLoader();

I think the only way is to refactor PackageResource for this
And give us a class instead of a package.

johan

Dariusz Wojtas wrote:

The code that worked in the morning, retrieved from HEAD, does not
work anymore now.
Just a call to DatePicker resources produces a stacktrace on the
appserver console.
The stacktrace below appears for me for every datapicker resource
referenced from generated HTML page. My code has not changed - worked
in the morning with HEAD.
Now it stopped.
I am using eclipse + Jetty


23:29:30.546 WARN!! [SocketListener0-1]
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)
11> /app/resources/wicket.extensions.markup.html.datepicker.DatePicker/calendar.js:

java.lang.NullPointerException
at wicket.util.resource.locator.ClassLoaderResourceStreamLocator.locate(ClassLoaderResourceStreamLocator.java:58) at wicket.util.resource.locator.AbstractResourceStreamLocator.locate(AbstractResourceStreamLocator.java:109) at wicket.util.resource.locator.DefaultResourceStreamLocator$1.locate(DefaultResourceStreamLocator.java:53) at wicket.util.resource.locator.ResourceStreamLocator.locate(ResourceStreamLocator.java:124) at wicket.markup.html.PackageResource.getResourceStream(PackageResource.java:181) at wicket.protocol.http.WicketServlet.getLastModified(WicketServlet.java:338)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:592)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
    at org.mortbay.http.HttpServer.service(HttpServer.java:954)
    at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
    at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
    at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
    at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)


-------------------------------------------------------
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-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
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


--
http://www.desktopbeautifier.com/


-------------------------------------------------------
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-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to