Home > FAQs > How can we display dynamic or static images that can be provided as an array of bytes

To display an image represented as an array of bytes

  • Reference an Action for the image src attribute
  • Provide a helper method on the Action to return an array of bytes
  • Provide a Result Type that renders the array to the response

Reference an Action

MyAction.jsp

Provide Helper Methods

MyAction.java

Provide a Custom Result Type

struts.xml
MyBytesResult.java