Two Laptop Bag*
The moose likes Struts and the fly likes calling an action through html:img tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "calling an action through html:img tag" Watch "calling an action through html:img tag" New topic
Author

calling an action through html:img tag

rahul gadge
Greenhorn

Joined: Mar 14, 2006
Posts: 1
hi,
I have to display an image and some text in a page. The problem is that image is in form of byte array. To show this image as byte array i have changed the content type in jsp accordingly and this jsp is working fine. But since i have to display both image and text in the screen i need to create a jsp that will have an html:img tag which would call the action which in turn would invoke the jsp contaning logic of displaying byte array as image.
i tried this but the action mentioned in html:img tag is not being called. Can anyone please help me out why this is happening.
Thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
There is an example of this in the struts-examples.war file that comes with the Struts download. Look at html-img.jsp and org.apache.struts.webapp.exercise.ImageAction. It looks like this example is doing pretty much what you're trying to do.


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: calling an action through html:img tag
 
Similar Threads
Ho to display image getting from byte array in JSP ?
display image from Action class?? Please help
How to show byte[] as image in jsp page?
Unable to generate error from Action class !
Putting an image on JSP