Showing posts from November, 2015

Learn REST with Spring

The popularity of REST-style APIs is not decreasing so a good knowledge in this architecture style becomes essential in many projects. In Java, there are many frameworks that you as a developer can utilize in order to build a REST-style API, with Spring MVC as one of the most popular. If you wish to learn how to work effectively with REST in Spring you definitely need some good learning materials.

Spring Boot with Gradle and resource filtering

Recently, while working on a rather small Spring Boot web application, I encountered an issue: after the deployment of a WAR file the application did not serve fonts and and other binary files properly. And the issue was with the invalid configuration of resource filtering in Gradle.

HOW-TO: Register components using @Conditional and Condition in Spring

@Profile annotation in Spring can be used on any Spring components (e.g. @Component, @Service, @Configuration etc.) that are candidates for auto-detection. @Profile annotation accepts a single profile or a set of profiles that must be active in order to make the annotated component eligible for auto-detection. For a given @Profile({"p1", "!p2"}), registration will occur if profile p1 is active or if profile p2 is not active. The or is crucial here. But how to achieve this with @Profile: we want to activate a given component if profile p1 is active and if profiles p2andp3 are both inactive?

HOW-TO: Java 8 Date & Time with Thymeleaf and Spring Boot

If you happen to work with Spring Boot and Thymeleaf and you need to format Java 8 Date & Time objects in your views you may utilize thymeleaf-extras-java8time - Thymeleaf module for Java 8 Date & Time API.