Review
In the previous section, we have laid down the functional specs of the application. In this section, we will start writing the Java classes and discuss the project's structure.Table of Contents
Part 1: Introduction and Functional SpecsPart 2: Java classes
Part 3: XML configuration
Part 4: HTML form
Part 5: Running the Application
Project Structure
Our application is a Maven project which means our project follows the Maven structure.Here's a preview of our project's structure:
Domain Layer
The domain layer contains a Message class that is used as a container to hold file details.Message.java
The domain layer also contains an UploadedFile class which is used for sending file information after it has been processed by the controller.
UploadedFile.java
Controller Layer
The controller layer contains a simple controller that serves a form for uploading files. There are two important endpoints here:- /message - processes the file descriptions
- /file - receives the files themselves
To simplify this tutorial, we're not persisting the messages and files in a database or to the disk.
UploadController.java
Others
StatusResponse is used to determine the status of a request, and includes an error message if any.StatusResponse.java
Next
We've completed writing our Java classes. In the next section, we will start writing the configuration files. Click here to proceed.
Share the joy:
|
Subscribe by reader Subscribe by email Share
Please correct the link to the Part 1.
ReplyDeleteThanks for pointing that out. It's now corrected. Cheers
Deletei cannot see java files, could you please correct it.
ReplyDeleteIt's on Part I. See https://github.com/krams915/spring-fileupload-tutorial/tree/master/spring-fileupload-tutorial
DeleteThis is good for file having small in size may be less than 10 MB. Please tell us for processing bigger files like 200 MB and 300 MB files.
ReplyDeletethank you bro :)
ReplyDeleteI have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteSpring online training Spring online training Spring Hibernate online training Spring Hibernate online training Java online training
spring training in chennai spring hibernate training in chennai
Thanks bro work (y)
ReplyDeleteInternet Business Ideas for 2020
ReplyDelete