Spring Boot WebFlux + Server-sent events example

In this article, we will show you how to develop a reactive web application, using Server-sent events Spring Boot 2.1.2.RELEASE Spring WebFlux 5.1.4.RELEASE Thymeleaf 3.0.11.RELEASE JUnit 5.3.2 Maven 3 In Spring, returns JSON and header MediaType.TEXT_EVENT_STREAM_VALUE @RestController public class CommentController { @GetMapping(path = "/comment/stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE) public Flux<Comment> feed() { //… } } In …

Read more

Spring Boot WebFlux + Thymeleaf reactive example

In this article, we will show you how to develop a reactive web application. Spring Boot 2.1.2.RELEASE Spring WebFlux 5.1.4.RELEASE Thymeleaf 3.0.11.RELEASE Maven 3 Spring Boot will configure everything, and the key is using the Thymeleaf ReactiveDataDriverContextVariable to enable the data-driven mode in Thymeleaf template. @RequestMapping("/") public String index(final Model model) { // data streaming, …

Read more

Maven – How to create a multi module project

In this tutorial, we will show you how to use Maven to manage a Multi-module project containing four modules : Password module – Interface only. Password md5 module – Password module implementation, MD5 password hashing. Password sha module – Password module implementation, SHA password hashing. Web module – A simple MVC web app to hash …

Read more

Spring Boot Hello World Example – Thymeleaf

In this article, we will show you how to develop a Spring Boot web application, using Thymeleaf view, embedded Tomcat and package it as an executable JAR file. Technologies used : Spring Boot 2.1.2.RELEASE Spring 5.1.4.RELEASE Thymeleaf 3.0.11.RELEASE Tomcat embed 9.0.14 JUnit 4.12 Maven 3 Java 8 1. Project Directory 2. Maven Put spring-boot-starter-web and …

Read more

Spring MVC hello world example (Maven and Thymeleaf)

This tutorial shows you how to create a Spring Web MVC application with the Thymeleaf template. Technologies and tools used: Java 11 Spring 5.2.22.RELEASE Thymeleaf 3.0.15.RELEASE Embedded Jetty Server 9.4.45.v20220203 Servlet API 4.0.4 Bootstrap 5.2.0 (webjars) IntelliJ IDEA Maven 3.8.6 Spring Test 5.2.22.RELEASE Hamcrest 2.2 JUnit 5.9 Table of contents: 1. Spring Web MVC Basic …

Read more