Hello World 만들기 ( 패키지, 파일 생성 )
페이지 정보
작성자 관리자 작성일 24-06-03 12:00 조회 371 댓글 0본문
01. sample 패키지 밑으로 controller 패키지 생성
02. controller 패키지에 HelloController.java 생성

03. HelloController.java ( 소스 내용 )
package sample.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@GetMapping("")
public String hello() {
return "Hello 하이~";
}
}
04. 콘솔창에서 서버가 리스타트를 하지 않는다면 종료후 Rus as.. > Spring Boot App 실행
05. http://localhost:8080/ : 'Hello 하이~' 출력 확인
댓글목록 0
등록된 댓글이 없습니다.