Thanks Martin,

Uuuh. That is heavy-weight for my little uc :-)
Instead of using an image i use now
<code>
            WebComponent image = new WebComponent("itemSpot");
image.add(new SrcModifier(Model.<String> of("/resources/shop/img/transparency.png")));
</code>

My page is still stateless, and 404 is gone. So it seems to solve my problem.
But i really would like to understand the whole process :-)

Thanks
Mike

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

On Fri, Oct 7, 2011 at 10:25 AM, Mike Mander<wicket-m...@gmx.de>  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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to