Summary

In this chapter, we discussed file upload and error handling. Uploading a file is not really complicated. However, a big design decision is what to do with the uploaded files. We could have stored the images it in a database, but instead we chose to write it to the disk and save the location of each user's picture in their session.

We saw typical ways to handle exceptions at the controller level and at the servlet container level. For additional resources on Spring MVC error handling, you can refer to the blog post at https://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc.

Our application is looking pretty good already and yet the amount of code we had to write is very reasonable.

Stay tuned for the next chapter where we will see that Spring MVC is also a powerful framework to build REST applications.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.12.34