포트폴리오/SPRINGBOOT 옛날
1-04 : local server의 실행과 controller
서버관리자 페페
2022. 9. 25. 19:16
단 하나의 맥락
: 웹에서 프로젝트 실행
semiflow bundle
- contollrer 만들기
- localhost:8080/~ 실행
- 확인
Contorller | 위치 : src/main/java > "com.mysite.sbb" | |
@Controller | ||
target URL | method와 return되는 것 | |
@RequestMapping | (@Requestbody) |
package com.mysite.sbb;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class HelloController {
@RequestMapping("/hello")
@ResponseBody
public String hello() {
return "Hello World";
}
}