Posts

Showing posts with the label Hello World Example

Spring Boot + JSP - Hello World Example

Image
In the section, we will create a project for Hello Word Example with Spring Boot and JSP. Note  A quick side note here is that JSP has limitations on its own and even more so when combined with Spring Boot. So, we should consider the following template engines as better alternatives to JSP.  Thymeleaf   FreeMarker   Mustache Groovy Technologies  used: Spring Boot 3.0.1 Spring 6.0.3 Maven Java 17 1. Creating a simple Spring Boot Application  First, open the Spring initializr https://start.spring.io/ Then, Provide the Group and Artifact name. We have provided Group name com.knf.dev.demo and Artifact spring-boot-jsp-helloworld . Here I selected the Maven project - language Java - Spring Boot 3.0.1 and add Spring web dependency.   Then, click on the Generate button. When we click on the Generate button, it starts packing the project in a .zip(spring-boot-jsp-helloworld.zip) file and downloads the project. Then, Extract the Zip file. 2. Final Project Directory 3. Project Dependencies For

Angular + Spring Boot - Hello World Example

Image
In the section, we will create a project for Hello Word Example with Spring Boot 3 and Angular 15. Part 1 - Backend development Step 1: Creating a simple spring boot web application.   First, open the Spring initializr https://start.spring.io/ Then, Provide the Group and Artifact name. We have provided Group name com.knf.dev.demo and Artifact helloworld . Here I selected the Maven project - language Java - Spring Boot 3.0.1 and add Spring web dependency. Then, click on the Generate button. When we click on the Generate button, it starts packing the project in a .zip( helloworld .zip ) file and downloads the project.  Then, Extract the Zip file. Step 2: Import the project on your favourite IDE, I am using IntelliJ IDEA Final Project Directory: 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 =&qu

Ktor Hello World Example

Image
In the section, we will create a project for Hello Word Example. Step 1: Open Ktor Initializr  https://start.ktor.io/ Step 2: Provide the Project Name We have provided ktor-helloworld. Step 3: Provide the Website name. We have provided the com.knf.dev . Step 4: Provide the Artifact Id. We have provided the dev.knf.com.ktor-helloworld . Step 5: Click on the Add plugins button. Step 6: Click on the Generate project button.  Step 7: Extract the ZIP file. Step 8: Import the project folder When the project imports successfully, it shows the following project directory in the Package Explorer section of the IDE. Project Directory Routing.kt package dev.com.knf.plugins import io.ktor.server.routing.* import io.ktor.http.* import io.ktor.server.application.* import io.ktor.server.response.* import io.ktor.server.request.* fun Application . configureRouting () { routing { get ( "/" ) { call .respondText( "Hello World!" ) } } } Copy Applica