Spring MVC: Designing Real-World Web Applications
by Shameer Kunjumohamed, Hamidreza Sattari, Alex Bretet, Geoffroy Warin
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access