2025-02-06



plugins {
id 'java'
id 'org.springframework.boot' version '3.4.2'
id 'io.spring.dependency-management' version '1.1.7'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
tasks.named('test') {
useJUnitPlatform()
}
package com.example.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HelloController {
@RequestMapping("/")
public String index() {
return "index";
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h2>방가방가</h2>
</body>
</html>'Spring, Boot > 기초 내용 정리' 카테고리의 다른 글
| Spring Boot_00 (1) | 2025.02.06 |
|---|---|
| Spring(AOP)_01 (0) | 2025.02.06 |
| Spring(AOP)_00 (0) | 2025.02.06 |
| Spring(FileUpload)_01 (0) | 2025.02.06 |
| Spring(MyBatis)_04 (0) | 2025.02.05 |