Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

dynamic paths for images-- <img src="x"

843836Apr 15 2004 — edited Apr 15 2004
I am trying to dynamically change the src attribute of an image tag in a JSP at compile time.
I have an easy solution that uses scriptlets:
<img src="images/<%=aBean.getThePath()%>">
but I would prefer to use a pre-existing taglib to acheive this instead- without using a scriptlet.
this comes close:
<html:img paramName="aBean" paramProperty="thePath" paramId="aParam" src="images/"/>
but renders the following:
<img src="images/?aParam=anImage.jpg">
it is setup to pass param=value pairs which is overkill for my purposes. I don't want to retrieve images from a servlet, I just want to modify the image URL with values from a DB.

It should end up like so:
<img src="images/anImage.jpg">
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 13 2004
Added on Apr 15 2004
2 comments
431 views