inblog logo
|
Noah Lee
    스프링입문

    스프링 웹 개발 기초

    스프링 입문, 정적 컨텐츠, MVC와 템플릿 엔진, API
    Feb 23, 2024
    스프링 웹 개발 기초
    Contents
    정적 컨텐츠MVC와 템플릿 엔진API
    정적 컨텐츠MVC와 템플릿 엔진API
    본 글은 김영한님의 스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술 을 학습하고 기록한 글 입니다.

    정적 컨텐츠

    notion image
    • 스프링 부트는 정적 컨텐츠 기능을 자동을 지원
    • 톰캣 서버에서 해당하는 컨트롤러 먼저 찾아보고 있으면 컨트롤러 로직을 타고
      • 없으면 정적 파일 찾아서 반환(resources:static/OOOO.html)

    MVC와 템플릿 엔진

    notion image
    • 브라우저에서
    • Controller 에서 return 해준 hello-template를
    • viewResolver(thymeleaf)에서 template 아래의 hello-tmplate.html을 찾고 모델 HTML로 변환 후 return

      API

      notion image
      • ResponseBody 어노테이션이 붙어 있고, 객체가 반환이 되면 Json으로 반환
      • 객체를 JSON으로 바꾸어 주는 것은 HttpMessageConverter를 통해 생성
       
      GitHub - YongHyeonLeeKr/hello-spring at ff836dbe256e0f3d161a091bc6e58b59c4d9e142
      [김영한] '스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술' 강의 학습 레포지토리 - GitHub - YongHyeonLeeKr/hello-spring at ff836dbe256e0f3d161a091bc6e58b59c4d9e142
      GitHub - YongHyeonLeeKr/hello-spring at ff836dbe256e0f3d161a091bc6e58b59c4d9e142
      https://github.com/YongHyeonLeeKr/hello-spring/tree/ff836dbe256e0f3d161a091bc6e58b59c4d9e142
      GitHub - YongHyeonLeeKr/hello-spring at ff836dbe256e0f3d161a091bc6e58b59c4d9e142
       
      Share article
      Contents
      정적 컨텐츠MVC와 템플릿 엔진API

      Noah Lee

      RSS·Powered by Inblog