Hello World 만들기 ( 패키지, 파일 생성 )
페이지 정보

본문
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 하이~' 출력 확인
- 이전글● 첫 프로젝트 생성 및 테스트 24.06.03
- 다음글▣▣▣ WorkSpace , Refresh using , server 설정 ▣▣▣ 24.06.03
댓글목록
등록된 댓글이 없습니다.