Today we’re going to learn CRUD example using Spring boot, Kotlin and AngularJS with WebJar. For this tutorial, nothing is assumed except some basic Java experience. We’ll show you how simple it is to create compliant and flexible REST services using the incredible frameworks Spring Boot and Kotlin. We’ll go through the how and why of it all, step-by-step so you can comfortably explore further on your own.
What is and Why Spring Boot?
Spring Boot is a Spring module which provides RAD (Rapid Application Development) feature to Spring framework. It is used to create stand alone spring based application that you can just run because it needs very little spring configuration.
Advantages of Spring Boot
- Create stand-alone Spring applications that can be started using java -jar.
- Embed Tomcat, Jetty or Undertow directly. You don’t need to deploy WAR files.
- It provides opinionated ‘starter’ POMs to simplify your Maven configuration.
- It automatically configure Spring whenever possible.
- It provides production-ready features such as metrics, health checks and externalized configuration.
- Absolutely no code generation and no requirement for XML configuration.
How to set up Spring Boot application with Kotlin?
We’re going to create step by step Spring Boot application so if you’re aware with this step then you can skip to next part.
See this : What is Nothing Type in Kotlin?
Click on File>New>Spring Starter Project(SSP).
Note : If you didn’t find SSP then click on Other after New and search spring then you’ll get option of SSP in list. Then select SSP and click next.
Add Project Name and description in next panel and click on next button.
In next panel you’ll see the dependencies screen and here i am using web and MySQL dependencies. After add all desired dependencies click on next and finish.
You’ll see the file structure like given below screen:
Run your SprinBootCrudApplication.java then you’ll see message like ;
But when you’ll open http://localhost:8080/SpringBootCRUD you got “Whitelabel Error Page” but don’t worry we’ll work on it in next part.