I have no experience with jsp and I am trying to help my colleague in an old struts2 project.
We receive from the backend some information about the characteristics of a product. One of this information is the image in a base64 format . . And I want to set it in the <img src...>
If I set it in a div I can see the image info (the base64 string) printed on the browser.
<div id="<s:property value="%{#attribute.id}"/>" > </div>
But if I try to do something similar for the <img element, the source element is not filled properly. I have this:
<img src="<s:property value="%{#attribute.id}"/>" transform='<s:property value="%{#attribute.transformFunction}" />' />
The transform operation is to add 'data:'to the beginning of the base64 string (don't know why it doesn't come with it initially)
In the console if I inspect both elements I got this 1st
<div id="image" transform="transformBase64ToImage" original="iVBOR...(base64string here)">data:image/gif;base64,iVBOR...(base64string here)</div>
2nd - obviously doesn't load any image
<img src="image" transform="transformBase64ToImage">
How can add the base64 string to the image source property?