Well, you have to use a relative URL. Wicket actually has good support
for this if you put the image in the same package as the HTML that
references it. You just have to remember to wrap the <img> tag in
<wicket:link> tags:

<wicket:link>
  <img src="foo.gif">
</wicket:link>

Your image will work both when you preview and at runtime.

This makes it really easy to create reusable components that require
images, since you don't have to always copy the image to the common
images folder.

jk

On Wed, Apr 18, 2007 at 09:09:53AM -0700, nlif wrote:
> 
> Hi,
> 
> I understand that it is the recommendation to place html files in the src
> folder, along with the corresponding java files. However, what about images?
> Should I place them with the html and java files as well? 
> I can actually think of good reasons for placing all images in a central
> place. 
> More specifically, I have this problem: if I write in my html: &lt;img
> src="img/mylogo.gif"&gt; then for wicket to find the gif at run-time, it
> needs to be under [web-root]/img. However, during development, when I want
> to preview the html, I will not see the img. How can I see it in BOTH in
> preview-mode, AND during runtime?
> 
> Thanks,
> Naaman
> 
> * I know this is probably a very basic question, but I'm new to Wicket, and
> I could not find an answer to this in the forum or documentation.
> 
> 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Where-to-place-images-tf3601705.html#a10061018
> Sent from the Wicket - User mailing list archive at Nabble.com.
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to