On 4/27/05, Gili <[EMAIL PROTECTED]> wrote: > Juergen Donnerstag wrote: > >>2) ResourceLink should not produce broken links > > > > The way StaticImageResourceReference works it does NOT care about the > > locale. It simply uses the class' packagename and the relative path > > provided. Though its base class ResourceReference seems to support > > locale and style, StaticImageResourceReference definitely does not. > > I'd suggest, but may be there are better solutions, to copy or > > subclass StaticImageResourceReference and replace newResource() with > > an implementation which takes locale into account. Shouldn't be that > > difficult for you. > > I don't think this will help. I tried manually appending the locale > and > style to the image URL, copy pasting that into my browser, and I still > got a broken link. So I think there is another bug at play here. >
so you tried something like StaticImageResourceReference(getClass(), "sunset/Outburst_by_dilekt_en_US.jpg")); (you see the locale in the path provided?) and it didn't work? How does the link generated look like? I think (not 100% sure) it should be like .../resources/com.be.desktopbeautifier.myPackage/sunset/Outburst_by_dilekt_en_US.jpg > You mention that StaticImageResource does not take locale and style > into consideration whereas ResourceReference does. My first question is: > does it matter? To my understanding, it is up to ResourceLink to > generate a URL from the underlying resource, which it gets from > StaticImageResource which is missing locale and style. So fine, but when > you hit the URL without the locale and style, whose responsibility is it > to retrieve the resource? I mean, if StaticImageResource produced the > URL in the first place, shouldn't it then take responsibility for > mapping the URL back to the appropriate resource? I'm just wondering > whose responsibility it is to do this mapping -- where does the bug lie? > you're right in that StaticImageResource COULD do it and if it were it'd be its responsiblitiy, but obviously it has not been defined like that.. As I mentioned, simply create your own more sophisticated StaticImageResource and add the functionality required. StaticImageResource is as simple as a java class can be. No magic, nothing. Juergen ------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id5hix _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
