Navigate Select ESC Close

#13 Spring Boot Web

2024-05-25 Science & Technology
103.3k
2.2k
196
Telusko
Telusko
2.8m subscribers

Unlock all features

FREE: Get instant access to 10 AI summaries, chats, or transcripts per day.

Description

Git Repo : https://github.com/navinreddy20/spring6yt Check out our courses: AI-Powered DevOps with AWS Live Course V2: https://go.telusko.com/ai-devops-v2 Coupon: TELUSKO10 (10% Discount) Java Spring Boot AI Live Course: https://go.telusko.com/JavaSpringBootAI Coupon: TELUSKO20 (20% Discount) Master Java Spring Development : https://go.telusko.com/masterjava Coupon: TELUSKO20 (20% Discount) Udemy Courses: Java Spring:- https://go.telusko.com/Udemyjavaspring Java:- https://go.telusko.com/udemyteluskojava Spring: https://go.telusko.com/udemyteluskospring Java For Programmers:- https://go.telusko.com/javaProgrammers Python : https://go.telusko.com/udemyteluskopython Git : https://go.telusko.com/udemyteluskogit Docker : https://go.telusko.com/udemyteluskodocker For More Queries WhatsApp or Call on : +919008963671 website : https://courses.telusko.com/ Instagram : https://www.instagram.com/navinreddyofficial/ Linkedin : https://in.linkedin.com/in/navinreddy20 TELUSKO Android App : https://go.telusko.com/TELUSKOAPP TELUSKO IOS App : https://apple.co/3SsgmU2 Discord : https://discord.gg/D8hWe9BqfF

Top Comments (10)

@Alcatraz-23 2024-05-30

Pls continue, we need this series, its a gem, every video is a masterpiece!!

36
@sphiwemodise5713 2026-05-30

Thanks for this series. It's really informative

0
@mathavan7209 2024-05-25

Please continue this series sir, your explanation was simple and good

11
@SakaPaulo 2026-02-09

I already finished all the course, now i'm watching for pratcing! Thank you so much our teacher, God bless you!

0
@RockyRaheshsarma 2026-01-28

You explain things with passion. This is what makes you a great teacher. It also keeps me motivated.

0
@timetorelax8997 2025-01-15

1. @Controller Marks a class as a Spring MVC Controller. Primarily used to handle web page navigation by returning view names. It is often combined with a view template engine (e.g., Thymeleaf, JSP). By default, methods in a @Controller class return a view name (not raw data). Example: java Copy code @Controller public class HomeController { @RequestMapping("/home") public String homePage() { return "home"; // Resolves to home.jsp or home.html (view template). } } 2. @RestController Combines @Controller and @ResponseBody. Indicates that the class is designed for REST APIs. Methods return data (e.g., JSON, XML) directly instead of a view name. Example: java Copy code @RestController public class ApiController { @RequestMapping("/api/data") public String getData() { return "This is JSON data"; // Response body returned directly. } } 3. @ResponseBody Indicates that a method's return value should be written directly to the HTTP response body (as JSON or plain text) instead of rendering a view. Often used in @Controller methods when returning raw data. Example with @Controller: java Copy code @Controller public class DataController { @RequestMapping("/api/message") @ResponseBody public String getMessage() { return "Hello, this is a response from @Controller with @ResponseBody."; } } 4. @RequestMapping Maps HTTP requests to specific handler methods. Can be used on classes (for a base URL) or methods (for specific endpoints). Supports additional attributes like method (e.g., GET, POST). Example with Method Mapping: java Copy code @RestController public class RequestController { @RequestMapping(value = "/api/users", method = RequestMethod.GET) public List<String> getUsers() { return List.of("Alice", "Bob", "Charlie"); } } Example with Class-Level Mapping: java Copy code @RestController @RequestMapping("/api") public class UserController { @RequestMapping("/users") public List<String> getUsers() { return List.of("Alice", "Bob", "Charlie"); } @RequestMapping("/roles") public List<String> getRoles() { return List.of("Admin", "User", "Guest"); } } Differences and Use Cases Annotation Use Case @Controller For rendering views (e.g., JSP, Thymeleaf). Often used in web applications. @RestController For building RESTful APIs. Methods return data directly (e.g., JSON). @ResponseBody Converts method return values to HTTP response body (use in @Controller for raw data). @RequestMapping Maps HTTP requests to handler methods. Flexible for REST and traditional controllers.

35 1 replies
@WealthGlitchAI 2024-06-28

i don't know what to say but you make spring looks like very easy to understand, Thanks from Morocco

4
@lootster 2024-05-31

00:01 Understanding client-server architecture and its application in web and mobile development 02:03 Server used to send layout and data, but now separate applications for front and back end 04:04 Adding Spring Web dependency for Spring Boot Web startup project 05:59 Spring Boot allows running a web project without coding 08:08 Creating a controller class to handle server requests 10:20 Using @Controller in Spring Boot for handling multiple requests 12:24 Spring web returning data 14:24 Using Rest Controller to return data 16:31 Introduction to Spring MVC front controller 18:22 Sending data from client to server

6
@srinivasreddy81792 2025-06-19

Getting a better understanding of springboot only because of your perfect explanations and examples. Thank you so much

0
@kushal6065 2024-08-20

Pls continue, we need this series, its a gem, every video is a masterpiece!!

0

Unlock the Data Inside
Turn Videos into Knowledge

  • Get FREE 10/day: transcripts, summaries, chats
  • Chat with videos, export text & PDF
  • $1 free API credit for RAG, chatbots & research

Free forever plan • All features unlocked

App screenshot