Nearby lessons

3 of 10

Spring Boot - Your First Application

📌 What You Will Learn
  • Understand Spring Boot - Your First Application
  • See working code examples
  • Learn from common mistakes and Q&A

Learn Spring Boot - Your First Application step by step — simple explanations, complete programs with their output, common beginner mistakes, and exam-style MCQs.

HelloController.java

---------------------------

package com.durgasoft.controller;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

@RestController

@EnableAutoConfiguration

public class HelloController {

@RequestMapping("/hello")

public String sayHello() {

return "Hello User!";

}

}

Access the above controller class by using the following URL at client browser after

executing HelloWorld standalone application.

http://localhost:1111/hello

Note: in URL, application name is not required to specify.

2.Steps to prepare Spring Boot Application by using STS[Spring Tool Suit] IDE:

-------------------------------------------------------------------------------------------------------

a)Download and instal STS in our System

b)Create Spring Starter project

c)

📝 Key Takeaways
  • Key ideas of Spring Boot - Your First Application explained simply
  • Ready-to-use code examples
  • Exam-style questions at the end