Skip to content
Shailesh Mishra edited this page Sep 2, 2020 · 1 revision

Example web app using contentstack and Spring Boot

A Sample Example Code for web-app using Spring-Boot, This guide is meant to give you a quick taste of the integration of Contentstack-Java SDK with the Spring Boot web-app. If you want to create your own Spring Boot-based project, visit Spring Initializr, fill in your project details, pick your options, and download a bundled up project as a zip file.

Step: 1 You will build a simple news web application with Spring Boot and contentstack Java SDK.

  • A favorite text editor or IDE

  • JDK 1.8 or later

  • Gradle 4+ or Maven 3.2+

Step: 2 How to complete this guide

Step: 3 For View Rendering

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

Step: 4 Run the Application

To run the application, run the following command in a terminal window (in the complete) directory

./gradlew bootRun

If you use Maven, run the following command in a terminal window (in the complete) directory:

./mvnw spring-boot:run

Now run the service with curl (in a separate terminal window), by running the following command (shown with its output):

$ curl localhost:8080
Headlines from Spring Boot!

Or simply click on the below URL hosted on Heroku app

Screenshot

Screenshot