You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Zeldor <pg...@gmail.com> on 2010/09/06 00:36:18 UTC
image path problem
Hi,
I am trying to group all my images into one folder, but the problem is that
I cannot get them displayed - that is as long as that folder path is higher
in the hierarchy than my html files.
So images/image.jpg works perfectly, but
/src/main/resources/images/resources/image.jpg does not, even though at
preview it shows the image correctly.
I was trying to add src in the class or even use ResourceReference, but no
luck. I am using Google Appengine, if it matters.
So, how to solve that? I'd really hat to put duplicates into every
subfolder.
P.S. When we are at images - how can I secure my hierarchy when someone
checks image details? Now it shows whole path to it, so like
/src/main/resources/images/resources/image.jpg, but I'd want it to show only
/image.jpg or nothing :)
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/image-path-problem-tp2527761p2527761.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: image path problem
Posted by Andrea Del Bene <an...@libero.it>.
Zeldor <pgronkiewicz <at> gmail.com> writes:
>
>
> Hi,
>
> I am trying to group all my images into one folder, but the problem is that
> I cannot get them displayed - that is as long as that folder path is higher
> in the hierarchy than my html files.
>
> So images/image.jpg works perfectly, but
> /src/main/resources/images/resources/image.jpg does not, even though at
> preview it shows the image correctly.
>
> I was trying to add src in the class or even use ResourceReference, but no
> luck. I am using Google Appengine, if it matters.
>
> So, how to solve that? I'd really hat to put duplicates into every
> subfolder.
>
> P.S. When we are at images - how can I secure my hierarchy when someone
> checks image details? Now it shows whole path to it, so like
> /src/main/resources/images/resources/image.jpg, but I'd want it to show only
> /image.jpg or nothing :)
Hi Zeldor,
you should take a look at class ContextImage in package
org.apache.wicket.markup.html.image. With this class you can easily load images
giving a path relative to the context root.
But if you want to hide images hierarchy I think you should delegate image
fetching to a page or a servlet and call it in src attribute.
example: <img src="showimage?img=tst.jpg"> where showimage is mapped to a
page or a servlet which retrieve the physic image path. However I' don't have
tried it.
bye bye!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org