R
RobM
Greetings
Have Tomcat -> Jboss -> Oracle database, using Struts within Tomcat. Looking
at uploading a file via struts <html:file...> which ends up via "FormFile"
interface within the struts form bean. This is fine, methods are
"getFileData" (returns whole file) or "getInputStream" (returns inputstream
to uploaded data). File is stored on database via EJB.
Thing is, considering best way to pass to EJB. Previously have passed full
data byte array (getData) to stateless EJB which writes to DB, ensuring
small file size. Now these could be larger files. I've read elsewhere
someone tried calling a stateful ejb to return an outputstream to the db
back to the web tier (action bean) which then subsequently called the same
ejb writing to the outputstream. But that sounds a bit unwieldy, passing
outputstream about to different tiers (didnt know this was good) and looking
afte stateful beans. But this may be the only way apart from passing the
full file in memory as byte array argument to the EJB function (almost wish
we were writing directly to the database from the web tier in this case -
i.e. outputstream - and not having to call an ejb!).
Best way to pass an uploaded file to EJB ?
ideas appreciated
Cheers
Rob
Have Tomcat -> Jboss -> Oracle database, using Struts within Tomcat. Looking
at uploading a file via struts <html:file...> which ends up via "FormFile"
interface within the struts form bean. This is fine, methods are
"getFileData" (returns whole file) or "getInputStream" (returns inputstream
to uploaded data). File is stored on database via EJB.
Thing is, considering best way to pass to EJB. Previously have passed full
data byte array (getData) to stateless EJB which writes to DB, ensuring
small file size. Now these could be larger files. I've read elsewhere
someone tried calling a stateful ejb to return an outputstream to the db
back to the web tier (action bean) which then subsequently called the same
ejb writing to the outputstream. But that sounds a bit unwieldy, passing
outputstream about to different tiers (didnt know this was good) and looking
afte stateful beans. But this may be the only way apart from passing the
full file in memory as byte array argument to the EJB function (almost wish
we were writing directly to the database from the web tier in this case -
i.e. outputstream - and not having to call an ejb!).
Best way to pass an uploaded file to EJB ?
ideas appreciated
Cheers
Rob