Posts

Showing posts with the label Spring Boot Examples

Swagger + Spring Boot with example

Image
Today, we will go through how to create API documentation using swagger and spring boot. Swagger is a framework for describing our API by using a common language that is easy to read and understand by developers and testers, even they have weak source code knowledge. Following technologies stack being used: Spring Boot 2.1.1.RELEASE Spring 5.1.3.RELEASE  Maven 3 JDK 1.8 Eclipse Oxygen Swagger 2 1)Project Structure 2)Maven/Dependency Management [pom.xml]  <?xml version = "1.0" encoding = "UTF-8" ?> <project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" > <modelVersion> 4.0.0 </modelVersion> <parent> <groupId> org.springframework.boot </groupId> <artifactId> spring-boot-st

Mustache + Spring Boot:Quick start

Image
Today, we will go through how to develop a Spring Boot web application using the Mustache template engine and package it as an executable JAR file. More related topics ..., Spring Boot + Mustache + JPA - CRUD example Spring Boot-JPA-Thymeleaf-CRUD Spring + Groovy Templates CRUD Example Spring Boot + FreeMarker + JPA - CRUD example Following technologies stack being used: Spring Boot 2.1.1.RELEASE Spring 5.1.3.RELEASE  Maven 3 JDK 1.8 Eclipse Oxygen Mustache 1. Project Structure 2. Dependency Management [pom.xml] <? xml version ="1.0" encoding ="UTF-8" ?> < project xmlns ="http://maven.apache.org/POM/4.0.0" xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance" xsi :schemaLocation ="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" > < modelVersion >4.0.0</ modelVersion > < parent > < groupId >or

Spring Boot Restful Service with JPA Configuration and H2 in-memory database

Image
Hello everyone, Today we will learn how to create REST API using Spring Boot, JPA and H2 In-memory database  Following technologies stack being used: Spring Boot 2.1.1.RELEASE Spring 5.1.3.RELEASE  Maven 3 JDK 1.8 Eclipse Oxygen Free Maker Hibernate 5.3.7 HikariCP 3.2.0 H2 in-memory database 1.4.197 1)Project Structure 2)Maven/Dependency Management [pom.xml]  <?xml version = "1.0" encoding = "UTF-8" ?> <project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0  https://maven.apache.org/xsd/maven-4.0.0.xsd" > <modelVersion> 4.0.0 </modelVersion> <parent> <groupId> org.springframework.boot </groupId> <artifactId> spring-boot-starter-parent </artifactId> <version> 2.1.1.RELEASE </version> <

FreeMarker + Spring Boot: Quick start

Image
In this post, we will go through how to develop a Spring Boot web application using the FreeMarker template engine and package as an executable JAR file. You can download the source code at the end of this post. Following technologies stack being used: Spring Boot 2.1.1.RELEASE Spring 5.1.3.RELEASE  Maven 3 JDK 1.8 Eclipse Oxygen Free Maker 1)Project Structure 2)Maven/Dependency Management [pom.xml]  <?xml version = "1.0" encoding = "UTF-8" ?> <project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" > <modelVersion> 4.0.0 </modelVersion> <parent> <groupId> org.springframework.boot </groupId> <artifactId> spring-boot-starter-parent </artifactId> <version> 2.1

Building a RESTful Web Service - Spring Boot

Image
Hello everyone, Today we will learn how to develop Restful service using Spring Boot Following technologies stack being used: Spring Boot 2.1.1.RELEASE Spring 5.1.3.RELEASE  Maven 3 JDK 1.8 Eclipse Oxygen   1. Project Structure                 2. Maven/Dependency Management [pom.xml]: <?xml version = "1.0" encoding = "UTF-8" ?> <project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" > <modelVersion> 4.0.0 </modelVersion> <parent> <groupId> org.springframework.boot </groupId> <artifactId> spring-boot-starter-parent </artifactId> <version> 2.1.1.RELEASE </version> <!-- lookup parent from repository --> </parent> <g