Spring WebMVC samples and links

[Index of Spring blogs]

Samples:
https://github.com/robbertvdzon/spring-web-mvc-samples/blob/master/src/main/java/com/example/demo/DemoApplication.java

Spring5 documentation about webMVC:
https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html

Spring Boot documentation about webMVC:
https://docs.spring.io/spring-boot/docs/2.1.0.RELEASE/reference/htmlsingle/#boot-features-developing-web-applications

Spring testing documentation about MVC Test Framework:
https://docs.spring.io/spring/docs/current/spring-framework-reference/testing.html#spring-mvc-test-framework

 

Securing REST calls in Spring

To secure REST services, you use Spring Security.

By adding spring security, users first need to login before they have access to any secured http calls.
There are multiple ways in implementing this, but I decided to provide my own UserDetailService  which provides the security mechanism the user details that it uses to authenticate the user. The advantage of this, is that my custom UserDetails object can later be accessed within rest calls to get more information about the logged in user (in my case, I wanted the userID to be available in the REST services).
Lees meer »