0

Following this post, I would like to provide images in a folder as shared resources.

I adapted following lines:

getSharedResources().add("images", new FolderContentResource(new  File(this.getServletContext().getResource("/images").getFile())));

In a wicket page, a shared resource is accessed as follows:

PageParameters params = new PageParameters();
    //params.set(0,"pic1.jpg");
    params.set("fileName","pic1.jpg");
    add(new Image("image", new SharedResourceReference("images"),params));

When setting the params with params.set(0,"pic1.jpg"), the method public void respond(Attributes attributes) is never called. Why do I have to set it via key, value as String pair?

Community
  • 1
  • 1
Chris
  • 89
  • 1
  • 10

1 Answers1

0

Check this blog article: http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/. It explains how to do it with a mounted resource reference.

martin-g
  • 17,243
  • 2
  • 23
  • 35