O'Reilly logo

Spring MVC Beginner’s Guide by Amuthan G

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The multipart request in action

In the preceding exercise, we learned how we can incorporate the static view to show product images in the products' details page. We simply put some images in a directory in the server and performed a configuration, and Spring MVC was able to pick up these files during the rendering of the page that had the product details. What if we automate this process? I mean instead of putting these images, what if we are able to upload images to the image directory?

How can we do this? There comes the multipart request. The multipart request is a type of HTTP request that sends the file and data to the server. Spring MVC has good support for a multipart request. Let's say we want to upload some files to the server. To accomplish ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required