Category: Spring MVC
Unit Test Spring MVC Rest Service: MockMVC, JUnit, Mockito
Previously we saw how to create a spring mvc restful web service. In this tutorial we continue by showing how to unit test this spring mvc rest service using JUnit, Mockito and Spring Test...
Spring MVC RESTFul Web Service CRUD Example
In this tutorial we show you how to build a RESTFul Web Service using Spring MVC 4. We create a controller that’ll manage CRUD operations like Create, Read, Update and Delete using the correct...
Spring MVC PDF View Example
This tutorial demonstrates how to create a PDF view using Spring MVC and itext. Out of the box spring only supports the older com.lowagie:itext library. The newest com.itextpdf:itext library is not supported by default....
Spring MVC Excel View Example
In this tutorial we demonstrate how to create an Excel view using Spring MVC. By utilizing Spring MVC Content negotiation we can have multiple views of the same resource. This example shows how to...
Spring MVC RSS ATOM Content Negotiation Example
In this tutorial we show a Spring MVC RSS ATOM Content Negotiation example. Using Content Negotiation we can serve different versions of a document (or resource) at the same URI. Depending on the HTTP...
Spring MVC Content Negotiation XML JSON
This tutorial shows you how to use Spring MVC Content Negotiation XML JSON features. According to wikipedia, “content negotiation is a mechanism defined in the HTTP specification that makes it possible to serve different...
Spring MVC Exception Handling
In this tutorial we take a look at how to use Spring MVC Exception Handling. We can design our application to deal with exceptions in various ways. We could handle the exceptions in the...
Spring MVC Download File Examples
In this tutorial we show you how to use Spring MVC to download a file. You can either download a file as an attachment or directly view the file inside the browser. To show...
Spring MVC File Upload Example + Validator
In this tutorial we show how to upload a file using Spring MVC and apache commons-fileupload. The uploaded file is validated against a custom Spring Validator. When the file exceeds the maximum allowed upload...