Hi Fernandes,
i think that it is impossible what You are trying to achieve.
You cannot pur image to img tag inside html.
Img tag will result in just another http request,
and this another request must be serviced by your server.

So the code will look like this:

<img src="/showMyimage.action?id=123" />

And showMyImage action will simply return image as a result.

Also read very carrefully above e-mail from Saeed!

Best greetings,
Paweł Wielgus.



2009/11/27 Saeed Iqbal <[email protected]>:
> Are you putting the file name in session string or the binary file?
>
> On Friday, November 27, 2009, Fernandes Celinio
> <[email protected]> wrote:
>> Hi,
>>
>> I have an entity bean which has a BLOB attribute. That BLOB attribute
>> maps to a BLOB column in a table in an Oracle database.
>>
>> @Entity
>> public class Boo implements Serializable {
>>  ...
>> @Lob
>>        �...@basic(fetch=FetchType.LAZY)
>>         private byte[] image;
>>
>>         public byte[] getImage() {
>>                 return image;
>>         }
>>
>>         public void setImage(byte[] image) {
>>                 this.image = image;
>>         }
>>
>> ...
>> }
>>
>> I also have an Action class where i query that entity bean and put the
>> result into the session :
>>
>> public class MyAction extends ActionSupport implements SessionAware {
>>         ...
>>   Public String someMethod() throws Exception {
>>
>>                 Boo boo = blaRemote.findById(l);
>>                 session.put("boo ", boo );
>>
>> ...
>> }
>>
>>
>> Finally in my JSP i display the various values of the attributes of that
>> Entity bean, including that image attribute :
>>
>>     <s:property value="#session.boo.attributeN" /> <br />
>>     <img src="<s:property value="#session.boo.image" />" /> <br />
>>
>> Of course I can display the value of all attributes except the image.
>>
>> How do you display an image with Struts 2 ? Is there a specific tag for
>> it ?
>>
>> Thanks for helping.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
> --
> Saeed Iqbal
> http://www.iqbalconsulting.com
> Struts - J2EE - Application Architect / Developer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to