Gareth, while storing the images in the databases is a possible(?) solution, it's one I'd like to avoid for the time being as I want to keep my database size as small as I can, therefore I just want to store the paths to the files for now.
Christian, the "pathToImage" returned by my subscriber dataobject is exactly that, a path to the image. I'd like to use this in the asset component instead of the path: <asset name="subscriber" path="ognl:subscriber.pathToImage" /> but the asset doesn't evaluate ognl expression, it's looking for a string full stop. I've tried to move the Asset from the .page into the class itself but I still get the same problem, the string for path has to be a constant, variables are not allowed. Brian. On 11/29/06, Gareth <[EMAIL PROTECTED]> wrote:
why not store the assets in a database, and write the image direct as raw? ----- Original Message ---- From: Brian Long <[EMAIL PROTECTED]> To: Tapestry users <users@tapestry.apache.org> Sent: Wednesday, 29 November, 2006 10:51:01 AM Subject: dynamic image assets? Hi, I'm sure there's a simple solution to this problem, but I've yet to figure out just what it is! I have an image associated with each subscriber that registers with my application, and on login I'd like to show them their picture along with their subscriber details. I know I can add an asset to the .page and have the Image component pick this up and display it <asset name="subscriber" path="/tmp/subscriber.gif" /> <component id="subscriberImage" type="Image"> <binding name="image" value="getAsset('subscriber')"> </component> The problem with this is that if I have 1000 subscribers, I need 1000 assets in my .page. I would like to store the image location as a property of my subscriber data object and retrieve the asset like this: <component id="subscriberImage" type="Image"> <binding name="image" value="getAsset('ognl:subscriber.pathToImage ')"> </component> Unfortunately, tapestry won't evaluate the ognl expression in the getAsset method call, and I get an error "value for parameter image in component is null and a non-null value is required". If someone has a solution to this, I'd be interested the hear about it. Regards, Brian. ___________________________________________________________ The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]