Writing to a file from a JSF managed bean

Hi,

I have a requirment where the jsf managed bean would receive a byte array from the business logic layer.

The byte array is actually an image file.

Now i need to write this byte array to a file in the server and display the image file in the JSF page

Please provide your valuable suggestions.

Thanks in advance,

James

[363 byte] By [JamesSelvakumar] at [2007-11-26 9:55:22]
# 1

Hi James,

Check these out, it could be useful in your case:

http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/fil e_upload.html

http://developers.sun.com/prodtech/javatools/jscreator/reference/code/sampleapp s/index.html#04

Databases (Queries): Retrieving Binary Data

This project demonstrates how a web application can upload binary files, such as image files, into a database so users can retrieve them for viewing.

http://developers.sun.com/prodtech/javatools/jscreator/reference/code/sampleapp s/popups/Demo_BLOB.html

HTH,

Sakthi

sakthivelgopal at 2007-7-7 1:16:00 > top of Java-index,Development Tools,Java Tools...
# 2
Hi Sakthi,Thank you veryyyyyyyyy much.I posted this question in many forums and got no reply.Your suggestions helped me to find a solution for this.I was struggling for the last few days with this issue.Thank you so much.
JamesSelvakumar at 2007-7-7 1:16:00 > top of Java-index,Development Tools,Java Tools...
# 3
Hi JSK,Am glad that you have got your issue resolved!Regards,Sakthi
sakthivelgopal at 2007-7-7 1:16:00 > top of Java-index,Development Tools,Java Tools...