SpringBoot으로 웹 출시까지 #4

springboot logo

4. thymeleaf를 이용해 레이아웃 만들기

1 myhome 만들기

https://start.spring.io/

 

project : maven

springboot :  최대한 낮은 버전 / SNAPSHOT X로 선택

group : godcoder

artifact, name : myhome

java: 8

dependencies : Thymeleaf / Spring Web / Spring Boot DevTools / Lombok

2 IntelliJ와 git 연동하기

https://github.com/

깃허브 계정이 없으신분들은 회원가입을 진행합니다.

그 뒤 강의 내용대로 진행하시면 됩니다.

저는 이번 클론 코딩을 진행하는 모든 코드를 한 번에 관리하기 위해 강의와 다르게 연동하였습니다.

git repository 생성 및 로컬 폴더 연결

을 누르시면 모든 프로젝트를 하나의 리포지토리로 관리 하실 수 있습니다.

3 bootstrap 적용

부트스트랩 스타터 탬플릿 적용

https://getbootstrap.kr/docs/5.0/getting-started/introduction/

– 강의 시점과 시간이 달라 버전이 업그레이드 되었습니다.

    코드가 달라지고, 명령어가 수정되었습니다.

    최대한 유사한 코드를 사용해서 작성했습니다.

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

    <title>Hello, world!</title>
  </head>
  <body>
    <h1>Hello, world!</h1>

    <!-- Optional JavaScript; choose one of the two! -->

    <!-- Option 1: Bootstrap Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>

    <!-- Option 2: Separate Popper and Bootstrap JS -->
    <!--
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
    -->
  </body>
</html>

Visual Studio Code 연결

컴퓨터에 자동 설치된 비주얼스튜디오를 실행시켜 프로젝트 파일(myhome – main – resources)을 열어줍니다.

template 폴더 아래 “index.html” 파일을 만들고 복사한 내용을 붙여넣습니다.

<html lang=“en”> -> <html>으로 수정합니다.

[intelliJ] HomeController 만들기

myhome 아래 “controller” 폴더를 생성하고,  “HomeController” 클래스를 작성합니다.

package com.godcoder.myhome.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class HomeController {
@GetMapping
public String index(){
return "index";
}
}

[VSCode]starter-template.css 작성

myhome – src – main – resources – static 아래 “starter-template.css” 파일을 생성합니다.

body {
padding-top: 5rem;
}
.starter-template {
padding: 3rem 1.5rem;
text-align: center;
}

“SpringBoot으로 웹 출시까지 #4”의 94,163개의 댓글

  1. Наркологическая клиника «Похмельная служба» в Балашихе оказывает профессиональную медицинскую помощь людям, столкнувшимся с алкогольной или наркотической зависимостью. Лечение организуется с учетом физической и психологической составляющей болезни: врач оценивает состояние человека, продолжительность употребления алкоголя или наркотиков, наличие хронических заболеваний, особенности поведения и мотивацию к трезвости. В клинике доступны консультация нарколога, вывод из запоя, детоксикация, снятие ломки, медикаментозное лечение алкоголизма и наркомании, кодирование, психотерапия, психологическая поддержка и реабилитация. Обращение проводится анонимно, а конфиденциальность персональных данных является одним из основных принципов работы центра.
    Подробнее – [url=https://narkologicheskaya-klinika-balashiha.ru/]narkologicheskaya-klinika[/url]

  2. Состояние пациента отслеживается на каждом этапе, от первичной консультации до дальнейших рекомендаций.
    Дополнительная информация – [url=https://narcolog-na-dom-voronezh017.ru/]https://narcolog-na-dom-voronezh017.ru[/url]

  3. The Wild Robin Casino is a trusted online gaming platform that has earned substantial interest among British gamblers searching for a reliable and thrilling casino experience [url=https://wild-robin-17.vercel.app]wild robin reviews[/url] . Known for its user-friendly design and varied range of games, The Wild Robin Casino has become the go-to choice for those looking for entertainment in the online gambling space.

    One of the main reasons why Wild Robin Casino is a cut above is its commitment to delivering a seamless gaming session. The platform is designed with both newcomers and seasoned gamblers in mind, ensuring that all users can appreciate their favourite games without frustration. With a wide array of slot games, including high-stakes and rolling prize pools, gamblers can put to the test their fortune and potentially earn a fortune. Moreover, the casino offers traditional game options like 21, roulette, and baccarat, providing the identical thrill as old-school brick-and-mortar casinos.

    For those who prefer a slightly interactive experience, Robin’s Wild Casino also offers live dealer games. These games allow gamblers to interact with professional hosts in live, bringing an additional layer of excitement to the gaming session. The live casino area is especially well-received among UK gamblers who value the realness and social side of playing against real opponents.

    Robin’s Wild Casino has also received favourable reviews from players across the UK. Many customers praise its fair gameplay, generous rewards, and excellent client service. The casino’s reputation as a reliable site has played a role to its growing popularity, making it a leading choice for those searching for a trustworthy online casino experience.

    If you’re new to Robin’s Wild Casino, it’s worthwhile to check out the available deals and bonuses. The casino frequently provides welcome deals, free revolutions, and rewards schemes to enhance the gaming session. Whether you’re gambling for entertainment or striving to win actual money, Wild Robin Casino delivers a engaging and interactive environment for all gamblers.

    In summary, Wild Robin Casino is a exceptional option for UK gamblers seeking a premium digital gaming adventure. With its varied game selection, fair gameplay, and outstanding client service, it continues to be a top pick among those searching for an fun and rewarding casino journey. Whether you’re discovering Robin’s Wild Casino for the very occasion or coming back for more action, you’re sure to discover something thrilling to play.

  4. Помощь может включать консультацию, детоксикацию, стационар и дальнейшее сопровождение по показаниям.
    Получить больше информации – [url=https://narkologicheskaya-kklinika-v-krasnoyarske17.ru/]лечение в наркологической клинике[/url]

  5. И уже не может остановиться сам. Родные не спят ночами. Нарколог на дом вывод из запоя — Осматривает, ставит капельницу. Потом давление выравнивают. Выведение из запоя на дому круглосуточно — Без лишних вопросов. Можете ознакомиться по ссылке: капельница от запоя на дому круглосуточно [url=https://pohmelye.vyvod-iz-zapoya-na-domu-samara-ice.ru]https://pohmelye.vyvod-iz-zapoya-na-domu-samara-ice.ru[/url] И про срочный выезд для региона. Иногда промедление стоит жизни.

  6. В этой статье рассматриваются актуальные вопросы, связанные с развитием медицинской науки и её внедрением в повседневную практику. Особое внимание уделено вопросам профилактики, ранней диагностики и использованию технологий для улучшения здоровья человека.
    Узнать из первых рук – [url=https://bookraj.ru/2025/09/19/mediczinskie-aspekty-primeneniya-infuzionnoj-detoksikaczii-pri-alkogolnoj-intoksikaczii-i-abstinentnom-sindrome/]нарколог на дом в Иркутске[/url]

  7. В этой публикации мы исследуем ключевые аспекты здоровья, включая влияние образа жизни на благополучие. Читатели узнают о важности правильного питания, физической активности и психического здоровья. Мы предоставим практические советы и рекомендации для поддержания здоровья и развития профилактических подходов.
    Ознакомьтесь поближе – [url=https://szkbk.ru/secrets-of-harmony/strategii-profilaktiki-zapoev-i-recidivov-dlya-podderzhaniya-trezvosti-i-formirovaniya-zdorovyx-privychek.html]deltaclinic[/url]

  8. wildrobin-Brexy

    the Wildrobin-18 site is an online platform that provides a distinctive opportunity for fans of the popular mobile game the Wild Robin game, especially those seeking gambling-inspired mechanics [url=https://wildrobin-18.onrender.com]wild robin casino uk[/url] .

    As one of the few dedicated communities for the Wild Robin game, this portal offers a space where players can discover in-game features, discuss strategies, and even unlock bonus content tied to the game’s betting features. Whether you’re a seasoned player or just starting with the Wild Robin game, this community acts as a valuable resource for enhancing your time spent in-game.

    For those new, Wild Robin is a popular mobile game that merges relaxed gaming with casino-inspired features, including betting, prize systems, and ranking battles. The hub at this Wild Robin portal serves as a hub for players eager to explore the betting features, offering tips on how to increase earnings, unlock bonuses, and participate in in competitive events. The mention of terms like wild robin casino review and Wild Robin betting in the UK suggests that the site may appeal to a regional market, providing guidance customised for local gamers.

    One of the notable aspects of this website is its concentration on wildrobin reviews and casino-style game analysis, where users can share their experiences, tips, and strategies. This player-led method helps beginners grasp the game’s systems more clearly, while offering veterans a chance to refine their skills. Moreover, the highlight of Wild Robin digital implies that the platform may also discuss online versions of the game, ensuring players remain updated of the recent changes.

    While the hub is still fairly focused, its focus on casino-style game feedback and player experiences makes it a useful tool for anyone looking to enhance their engagement with the Wild Robin game. Whether you’re eager about the top methods to gain virtual prizes or simply want to interact with other gamers, this site provides a structured method to investigate the game’s betting mechanics. For fans of Wild Robin, it’s a essential tool to their game collection, offering both fun and actionable insights.

댓글 달기

이메일 주소는 공개되지 않습니다.