Implement custom resources in JBoss Seam
When I was developing my Seam application I found it is hard to render a picture with byte array from database. You can use s:graphicImage to display a picture inside a web page. However I found that it is merely impossible to render a picture individually with facelets in.
The solution is to write a custom resource component. First you need to define a new class which extends org.jboss.seam.web.AbstractResource as your custom resource component. Register this component as resource provider like this:
org.jboss.seam.core.Init.instance().addResourceProvider("your_component_name");
Normally you can declear this in a @Create method of a application scope component.
Then you can write your codes in getResource() method. I paste my codes here. Hope that it can give you a little help.
Note that you need to add your Seam's resource path before the string you defined in getResourcePath(). For example, in this example, people can access the image via http://<your_domain>/seam/resource/images/<image_id>
