MCA
SPRING FRAMEWORK // ENTERPRISE CODE // ABSTRACT FACTORY // SPRING FRAMEWORK // ENTERPRISE CODE // ABSTRACT FACTORY //
BACK TO SYLLABUS
HARD

SPRING FRAMEWORK

Spring Boot, dependency injection, and REST APIs

CONCEPTS

01Inversion of Control (IoC)
02Dependency Injection (@Autowired)
03Spring Bean Lifecycle
04Spring MVC (@RestController)
05Spring Data JPA
06Application Properties

SYNTAX_DEMO

Enterprise web apps
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.*;

@SpringBootApplication
@RestController
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @GetMapping("/hello")
    public String hello(@RequestParam(value = "name", defaultValue = "World") String name) {
        return String.format("Hello %s!", name);
    }
}