See http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
for inspiration

On Fri, Oct 7, 2011 at 10:25 AM, Mike Mander <[email protected]> wrote:
> Hi,
>
> i use 1.5.1 (in 1.5 examples i couldn't find a matching one)
>
> I've packaged my application images to a package (<appname>.res.img).
> WicketApplication is located in root package (<appname>).
> In the images package there is a class ImageMounter which is loading all
> images in package and mount them this way
>
> ImageMounter.java
> <code>
> String image = ...; // The image name - one of then IS transparency.png
> WebApplication.get().mountResource("resources/shop/img/".concat(image), new
> PackageResourceReference(ImageMounter.class, image));
> </code>
>
> But if i try to use one of the images with the Image class like that:
> MyPanel.java
> <code>
> Image image = new Image("itemSpot", new
> PackageResourceReference("/resources/shop/img/transparency.png"));
> </code>
>
> MyPanel.html
> <code>
> <ul>
> <li wicket:id="leaflet"><a wicket:id="overImageToDetails"><img
> wicket:id="itemSpot" /></a></li>
> </ul>
> </code>
>
> i get a 404. Here is the stacktrace
> WARN  - ResourceReferenceRegistry  - Asked to auto-create a
> ResourceReference, but
> ResourceReferenceRegistry.createDefaultResourceReference() return null.
>  [scope: org.apache.wicket.Application; name:
> resources/shop/img/transparency.png; locale: null; style: null; variation:
> null]
> TRACE - error404                   -
> 16e4jys7nta9q1qq82q3q88dut;/wicket/resource/org.apache.wicket.Application/resources/shop/img/transparency.png
>
> I would like to know what i'm doing wrong and why?
> Thanks for helping me
> Mike
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to