Hi,

Check http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/


On Tue, Nov 5, 2013 at 10:49 AM, Ladislav DANKO <[email protected]> wrote:

> Hi folks!
>
> I'm using wicket 1.5.10, tomcat 7 and Java 6. In my code i do:
> public final class Images{
>   public static void mountGlobalStaticImages(){
>     //loading images from database works perfect
>     List<Object> imagesParams = GlobalTemplatesDAO.getGlobalImages();
>     for(Object record : imagesParams){
>       Map<String, Object> image = (Map<String, Object>) record;
>       //it's path like '/images/mylogo.png'
>       String imagePath = (String) image.get("file_mount_point");
>       //ComponentDynamicImage is extended DynamicImageResource, looks it
> works (it provides required byte[] data)
>       ComponentDynamicImage imageData = new ComponentDynamicImage((byte[])
> image.get("file_data"));
>       //problem is here: looks that it mount image isn't in app and in log
> is http status code '302'
>       //AppStart is extended WebApplication class
>       AppStart.get().getSharedResources().add(imagePath, imageData);
>     }
>   }
> }
>
> Problem is that images isn't here, in localhost_access_log.2013-11-04.txt
> are lines:
> 127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/icon-fb.png
> HTTP/1.1" 302 -
> 127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET
> /images/images/cz-ico.gif?53 HTTP/1.1" 200 9067
> 127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET
> /images/images/icon-fb.png?54 HTTP/1.1" 200 9068
> 127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET /images/images/en-ico.gif
> HTTP/1.1" 302 -
> 127.0.0.1 - - [04/Nov/2013:23:52:09 +0100] "GET
> /images/images/en-ico.gif?55 HTTP/1.1" 200 9067
>
> How to mount them properly? As far as i know problem is in 'AppStart.get().
> getSharedResources().add(imagePath, imageData)'
> but not know how to do it properly.
>
> --
> Ladislav DANKO
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to