Rather then answering the question you shoudl revise why you want to do that. This looks like a bad idea to me. If the images are permanent (which is unlikely since you want to store it with the app) then store it elsewhere in the filesystem or database. If the images are temporary store them in the memory (eg cache).
I tried storing the image in local filesystem. But i then couldn't access image in xhtml. I guess this is because all content must be placed in deployed war (which does not contain stuff from local filesystem).
Concerning storing them in memory: How do I do that? Do you mean storing image as byte? If so I'm struggling with finding tags that accept byte. I found one in seam tag library, but I don't know if I can install seam tag library with jboss7 and maven.
Well, its a fact that serving static images via Java is slower than letting Apache HTTPd serve them.
Thats why I think a better approach is to store images on the filesystem where HTTPd just serves them statically. In your Java side all you need is to send in your respose <img src="/static/images.png" /> and the context static just let the apache to handle and not pass all the way to Java. You will also have to handle deletion from the FS, authorization might become little bit more complicated. Anyway, depends on your use case :-)