Skip to content

A Sample Example Code for contentstack-Java SDK using Spring-Boot, This guide is meant to give you a quick taste of integration of Contentstack-Java SDK with Spring Boot web-app

Notifications You must be signed in to change notification settings

contentstack/contentstack-java-news-web-app-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contentstack Web Application using Java SDK and Spring Boot

Contentstack|Java

Java CI with Maven

A Sample Web Application created using Spring Boot and Contentstack Java SDK.

This guide provides step-by-step instructions to get up and running quickly with Spring Boot and create a web application with it using Contentstack Java SDK.

If you want to create your own Spring Boot-based project, visit Spring Initializr, fill in your project details, select your options, and download the project as a zip file.

Step 1: Set up the Essentials

  • Any text editor or IDE

  • JDK 1.8 or later

  • Gradle 4+ or Maven 3.2+

  • Contentstack account

Step 2: How to Use this Project

Step 3: Add Contentstack Dependency

add dependency:

For Maven

<dependencies>
    <dependency>
       <groupId>com.contentstack.sdk</groupId>
       <artifactId>java</artifactId>
       <version><latest></version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>

For Gradle

implementation 'com.contentstack.sdk:java:1.5.3'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:2.3.3.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-web:2.3.3.RELEASE'

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 have used Maven for this project then 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

Or Open your favorite browser and try calling: http://localhost:8080

Read Documentation

We have hosted our webapp on Herokuapp:

Screenshot

About

A Sample Example Code for contentstack-Java SDK using Spring-Boot, This guide is meant to give you a quick taste of integration of Contentstack-Java SDK with Spring Boot web-app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •