240 likes | 401 Views
MySQL, JavaBeans and File Upload. Download war file dbjavabean.war from the http://douap.uap.asia. Required Libraries in WEB-INF/lib folder. Digesting the JSP files. File i ndex.jsp. Eclipse path for the upload. Note that the upload code is included. Change to /.
E N D
Download war file dbjavabean.war from the http://douap.uap.asia
Eclipse path for the upload Note that the upload code is included Change \ to / Replace the Eclipse path with the actual deployment path in Tomcat
File MyDB.java Get only one record Store the values in a HashMap Values are of type String
Reading HashMap in index.jsp Set record id in MyDB bean From public HashMap<?,?> getMap()
Get more than one record HashMap in an ArrayList Refresh content
Reading ArrayList in index.jsp The Hashmap ArrayList
File upload.jsp • Includes image resize, database, and upload.
Value of path is from index.jsp. Set it right before uploading. Check for file permissions.
Understanding what is passed by the form name and value pairs of the form
Retrieve the file and store it in the hard drive based on the path
For thumbnails, resizing the file based on the size • Store in the database
File slideshow.jsp • Variable start dictates what the next image to show • Get all images,
Refresh Project Explorer to show the uploaded file. • Refresh page to reflect the uploaded image