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,153개의 댓글

  1. Помогаем быстро перейти от консультации к конкретному плану: выезд, стационар или наблюдение.
    Изучить вопрос подробнее – [url=https://vivod-iz-zapoya-voronezh17.ru/]вывод из запоя капельница на дому Воронеж[/url]

  2. В этом исследовании рассмотрены методы лечения зависимостей и их эффективность. Мы проанализируем различные подходы, используемые в реабилитационных центрах, и представим данные о результативности программ. Читатели получат надежные и научно обоснованные сведения о данной проблеме.
    Кликни и узнай всё! – [url=https://studiohallo.ru/lechenie-alkogolizma-v-murmanske-sovremennye-metody-i-vozmozhnosti-pomoshhi/]выводу из запоя в Иркутске[/url]

  3. Схема помощи зависит от состояния, стажа употребления, противопоказаний и дальнейших целей лечения.
    Изучить вопрос подробнее – [url=https://vivod-iz-zapoya-voronezh16.ru/]скорая вывод из запоя[/url]

  4. В этом исследовании рассмотрены методы лечения зависимостей и их эффективность. Мы проанализируем различные подходы, используемые в реабилитационных центрах, и представим данные о результативности программ. Читатели получат надежные и научно обоснованные сведения о данной проблеме.
    Получить дополнительные сведения – [url=https://goagetaway.com/page/preimushhestva-uslugi-narkologa-na-dom-v-irkutske]вывод из запоя на дому в Иркутске[/url]

  5. wildrobin-apatt

    Wildrobin is an online casino platform that has been gaining attention among UK gamblers looking for a trustworthy and exciting gaming experience [url=https://wildrobin-17.vercel.app]wild robin casino uk[/url] . Known as wild robin casino, this site offers a diverse range of games, including spin games, classic casino games, and real-time dealer games, catering to both casual and dedicated players. Whether you’re looking into reviews of Wild Robin Casino or simply checking out Wild Robin online, it’s important to grasp what makes this platform stand out in the competitive world of digital casino gaming.

    One of the main features of Wild Robin Casino is its intuitive interface, which ensures a seamless and pleasurable experience for UK-based punters. The site is built to be simple to use, making it straightforward for new players to explore while still offering high-end tools for those who like more control over their playing experience. Many Wild Robin Casino reviews highlight the platform’s dedication to equity, with frequent checks by well-known bodies to ensure transparency in betting outcomes.

    For those curious about wild robin reviews, the platform has received acclaim for its wide array of games, including trending spin games like “Robin’s Treasure” and traditional casino games such as 21 and the spinning wheel. The inclusion of live casino games adds an unique touch of realism, making the experience feel more engaging. Additionally, wild robin casino UK players benefit from lucrative promotions, including welcome offers and continuous deals, which increase the total worth of their betting experiences.

    Player safety and player service are also critical factors when judging Wild Robin Casino. The site employs advanced security measures to protect account details, ensuring that transactions and account data remain confidential. Client support is available 24/7, providing guidance through live chat, email, and direct call, which is a common highlight in Wild Robin reviews.

    In conclusion, Wild Robin Casino is a strong option for those looking for a comprehensive online gambling experience in the UK. With a firm dedication on transparency, diversity, and player support, it continues to attract attention in the wild robin casino review space. Whether you’re discovering wildrobin online for the very first time or reading up on detailed wildrobin casino reviews, this platform offers a highly recommended choice for contemporary players.

  6. В данном обзоре представлены основные направления и тренды в области медицины. Мы обсудим актуальные проблемы здравоохранения, свежие открытия и новые подходы, которые меняют представление о лечении и профилактике заболеваний. Эта информация будет полезна как специалистам, так и широкой публике.
    Провести детальное исследование – [url=https://chelnyhools.ru/llechenie-alkogolizma-v-irkutske/]нарколог на дом в Иркутске[/url]

  7. Капельница вывод из запоя на дому — это когда близкий пьёт неделю. Боятся оставить одного. Вывод из запоя на дому — Осматривает, ставит капельницу. Потом давление выравнивают. Выведение из запоя на дому круглосуточно — Без лишних вопросов. Советую глянуть источник: круглосуточный вывод из запоя [url=https://kapelnica.vyvod-iz-zapoya-na-domu-samara-sqm.ru]https://kapelnica.vyvod-iz-zapoya-na-domu-samara-sqm.ru[/url] И про вызов нарколога на дом запой для Самарской области. Не ждите, пока станет хуже.

댓글 달기

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