JavaBean is a Java-based software component. JSP provides perfect support for integrating Javabean components in web applications. This support not only reduces development time (can directly utilize test and trusted components, avoid repeated development), but also bring more scalability for JSP applications.
The upload function of the file is very common in B / S development model. Compared with other development tools, JSP's upload support for files is not perfect. It is neither a component that must be used as the ASP, and it is not as supported by file uploads like PHP. The implementation of the JSP implementation file upload is this: use the GetInputStream () method of the servletRequest class to get a client to send a data stream to the server, then process this data stream, analyze, get the file upload to pass to the server to each parameter and Data, then store the file data into a file or insert into the database. Usually the upload function of the file is not processed in the JSP page, but put these functions into the servlet or JavaBean. Examples uploaded using servlet have introduced in some JSP related books, I introduced how Jeanbean is uploaded using Jeanbean. The upload of the file in JSP can be implemented in two ways, namely HTTP protocol and FTP protocol implementation, and the two have great differences in the principle of transmission. The combined source code will be briefly introduced below, and believe that the reader will gain from it. The following procedures have been debugged. Debugging environment: Window 2000 Server Apache Tomcat4.0, JavaBean Debugging Environment: JDK1.4 Editplus.
Full text reading:
JavaBean implements two ways to upload multi-file upload