Jsp / Servlet / bean / upload

Hello,

I use a jsp to enter several fields. These fields are sent to a servlet by using a bean (recorded in the current session). Until now there is no problem. The servlet receives all information. Now I must also send 5 files which must be stored on the server. I have thus to add in my jsp 5 file fields.

My question :

Is it possible to integrate the FileUpload package for uploader my files without anything to change in my code (by using of a bean to exchange the data between my jsp and my servlet). ?

In other words, it is possible to use my bean to also transport files. ?

Tank u for u help

[635 byte] By [keopska] at [2007-10-3 1:39:29]
# 1
Why not retrieve the data in a servlet and then set the files in your bean? Of course you could do it in the bean itself, just pass the HttpServletRequest to your bean and then use FileUpload to fetch the files from it, but I'd say a servlet is a better place to do that.
gimbal2a at 2007-7-14 18:37:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Yes it is possible..download cos.jar from www.oreily.com for file upload..it will read dat from the form as two parts ..parameter part and file part..and you can implement it throgh a servlet easily..for more follow oreily JSP/servlets Cookbook
Jasdeep.Singha at 2007-7-14 18:37:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...