0

In my java web jsf seam jboss application, I want to add a row in a table with some data fields such as date type, String etc, but one field will be a word attachment, does anybody know any example of how to do it? thanks a lot for any help, Basically, there is a loop to create some rows of data in a table, before each table row data creation, I will create a word file and saved to a local path(the physical file path is hardcoded), then I will create a table row and attach this word file to that row. the loop will continue until the end of loop. I appreciate if anybody can know any resource or example codes. Thanks a lot,

smt
  • 71
  • 3
  • 10
  • so your class is what? one field is a byte[] storing the "attachment" ? And the problem is ? – Neil Stockton Nov 06 '14 at 11:34
  • [Reading a binary file into a single byte array in JAVA](http://stackoverflow.com/questions/7250229/reading-a-binary-file-into-a-single-byte-array-in-java) – wypieprz Nov 06 '14 at 12:29
  • Thanks a lot for you quick response, this table is a DB2 table schema, ideally, the word file attachment should be saved in DB2 table and then display this table (with the attachment) in the jsf data grid on jsf page. but I was told that to save attachment in db2 table is not a standard way to do because the file may be big, So that is why,I am think to save the word fille to a place of C:\\ drive, and save the file link to the DB2 table, so really, there will be an attachment link on the jsf data grid, and user can click to open the attachment from jsf page. – smt Nov 06 '14 at 13:20

0 Answers0