resourcereference

What are ResourceReferences in Wicket, and how do they work?

a 夏天 提交于 2019-12-22 05:33:51
问题 I have seen examples containing things like this: mountSharedResource("/images/logo.gif", new ResourceReference(ImageScope.class, "logo.gif").getSharedResourceKey()); mountSharedResource("/resource", Application.class.getName() + "/" + resourceKey); But the Javadoc says this for the constructor: ResourceReference(java.lang.Class<?> scope, java.lang.String name); So when you create a ResourceReference , you give it a class. Why? Usually you would want either global scope or the scope of the

Wicket serving images from File System

无人久伴 提交于 2019-12-21 05:31:17
问题 I am pretty new to Wicket and i have some difficulties with using resource references. I am using wicket 1.5.4 and have following problem: I store images on the file system. I have class ImageElement which holds part of the file path relative to configured rootFilePath (i.e dir1/dir2/img1.png). On the page I add Image as follows: new Image("id",ImagesResourceReference.get(), pageParameters) where page parameters includes image path parameter (path="/dir1/dir2/img1.png"). My questions are: Is

Wicket serving images from File System

佐手、 提交于 2019-12-03 16:28:53
I am pretty new to Wicket and i have some difficulties with using resource references. I am using wicket 1.5.4 and have following problem: I store images on the file system. I have class ImageElement which holds part of the file path relative to configured rootFilePath (i.e dir1/dir2/img1.png). On the page I add Image as follows: new Image("id",ImagesResourceReference.get(), pageParameters) where page parameters includes image path parameter (path="/dir1/dir2/img1.png"). My questions are: Is it the simplest way of serving images from the file system? Is it ok to use ResourceReference with