You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pe...@meteoswiss.ch on 2003/06/05 16:39:15 UTC

dynamic paths to images

I have to generate dynamic paths to images (depending on the date). My jsp scriplet looks like this:

<bean:define id="imagePath" name="imageProvider" property="path"/>
<img src='<%=request.getContextPath()%><bean:write name="imagePath"/>'>

where 'imageProvider' is an attribute in session scope with a property 'path'.

It works, however it is not very elegant. Who knows a nicer solution? Thanks.

Peter





---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: dynamic paths to images

Posted by Max Cooper <ma...@maxcooper.com>.
Write a custom tag that does it for you.

<myapp:img name="imageProvider" property="path" />

-Max

----- Original Message ----- 
From: <Pe...@meteoswiss.ch>
To: <st...@jakarta.apache.org>
Sent: Thursday, June 05, 2003 7:39 AM
Subject: dynamic paths to images


I have to generate dynamic paths to images (depending on the date). My jsp
scriplet looks like this:

<bean:define id="imagePath" name="imageProvider" property="path"/>
<img src='<%=request.getContextPath()%><bean:write name="imagePath"/>'>

where 'imageProvider' is an attribute in session scope with a property
'path'.

It works, however it is not very elegant. Who knows a nicer solution?
Thanks.

Peter





---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org