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">