How to display an image using tag in JSP

前端 未结 2 1464
挽巷
挽巷 2020-12-22 10:07

Here is the code to retrieve image in action class. I have tried it, but not able to display it I don\'t know about the image processing. How should I use tags in JSP to dis

2条回答
  •  醉话见心
    2020-12-22 10:36

    After retrieving an image from the database as Blob or byte array you are writing direct to response. In this case you should not return SUCCESS result, you need to return NONE result. Then in the JSP you could access an image as a separate thread using img tag that will call your action that return an image.

    See also How can we display dynamic or static images that can be provided as an array of bytes, and How to display image in Struts2.

提交回复
热议问题