Spring boot

Spring boot Annotations

In this tutorials explain the following annotations

RestController :  is used for creating a restful API services.

RequestMapping: is used for specify following request GET, PUT, POST, DELETE, etc.

Cross-origin :  is an important annotation which used to calling restful API request from the front-end application
like Anqular or React or vue js or other.

 

Create the new Controller as

TestController

package com.springschool.firstapp.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("api/v1/test")
public class TestController {

    @PostMapping
    public void getMyApp()
    {
        String myApp = "This my First Application";
        System.out.println(myApp);
    }
}

i have attached the video link below. which will do this tutorials step by step

admin

Recent Posts

Tesla Pi Phone: Is This the Next Super-Phone? Full Review & Details

What Is the Tesla Pi Phone?   Imagine if Tesla, the company that makes famous…

3 days ago

Tailwind CSS Inventory Management POS Project (Free Source Code)

Inventory Management POS systems are now an essential part of modern businesses such as bookshops,…

4 weeks ago

Build Simple Water System Calculator in Java Using Swing

If you're just beginning to learn Java GUI programming creating an Water System Calculator is a fantastic project for…

5 months ago

GitHub Copilot vs Microsoft Copilot Best AI Tool to Use in 2025

GitHub is a powerful tool used by teams and developers around the globe. This guide is…

5 months ago

Chat with Claude AI Free – Your Super-Smart AI Buddy

It's like having a super-smart buddy that is always there to help you write stories,…

5 months ago

Best Festivals UK 2025 [Free Guide Included]

The UK is known for its rich history, diverse culture, and most of all  its…

5 months ago