Jonathan Locke wrote:



Gili wrote:

Hi,

I've got an Image component and during rendering time, I want to get its href on server-side. What happens is that the Image is backed up by a dynamic image, it gets assigned a unique static filename during render time and I need to refer to that path. I tried Image.getResourcePath() but it only returns the filename whereas the href generated for the Image component contains a fully-qualified path relative to the root of the domain. I expect the two to be identical.


why do you need the ref? see examples on images. this is generally taken care of for you.


Because Wicket does not support CSS and I need to embed an Image component within a CSS style, what I do is generate an <img> tag with width/height of 0 (use it as a placeholder), Wicket generates the file and URL, then I grab that URL from the Java side and use AttributeModifier to push the URL into the CSS style. That's why :)

If you have a better idea, feel free to suggest it. At the end of the day I'm expecting getResourcePath() and the href attribute should match 1:1. Also, is there a way to specify which directory dynamic images will get dumped into? The reason I ask this is that I have a servlet filter that adds expiration headers (client side caching) to *.png and I'm thinking that maybe I am interested in applying different headers to different *.png files in different pages. If I could control the resulting URL, I could tell the filter only to touch *.png under that specific URL.

Gili


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to