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”의 96,059개의 댓글

  1. Запой развивается на фоне сформированной алкогольной зависимости и постепенно разрушает нормальный режим жизни. Человек начинает употреблять очередной объем спиртного, чтобы временно снять болезненные проявления абстиненции, однако облегчение длится недолго. Следующий прием напитков поддерживает интоксикацию, а общее состояние продолжает ухудшаться. Поэтому своевременная медицинская помощь позволяет контролировать процесс выхода из запоя и своевременно определить признаки опасных осложнений.
    Дополнительная информация – [url=https://6vyvod-iz-zapoya-podolsk77.ru/]вывод из запоя московский область[/url]

  2. Выездная наркологическая помощь позволяет начать лечение без поездки в стационар и лишнего стресса для человека. В зависимости от показаний услуги могут включать консультацию, вывод из запоя, детоксикацию, капельницу, снятие абстинентного синдрома и рекомендации по дальнейшему лечению зависимости. Если состояние пациента требует постоянного контроля, нарколог предлагает продолжить лечение в клинике. Решение принимается после оценки, поскольку дом подходит не для всех случаев алкогольной или наркотической интоксикации.
    Дополнительная информация – [url=https://narcolog-na-dom-voronezh015.ru/]врач нарколог на дом Воронеж[/url]

  3. А способ думать как врач. Даже если тема не по профилю. Медицинский журнал — Но о чём ещё спорят. Кто-то читает вестник хирургии. Вестник медицинских наук — И свои критерии. Вся информация доступна здесь: вестник неврологии нейрохирургии [url=https://ladyvibes.ru]вестник неврологии нейрохирургии[/url] И про то, где почитать бесплатно для врачей. Не останавливайтесь на учебниках.

  4. И уже не может остановиться сам. Родные не спят ночами. Капельницы от похмелья — И человеку становится легче. Сначала уходит интоксикация. Капельница на дому Екатеринбург — И в выходные. Можете ознакомиться по ссылке: капельница от похмелья купить [url=https://alkogolizm.kapelnicza-ot-pokhmelya-ektb-doe.ru]капельница от похмелья купить[/url] И про капельницу на дому сколько стоит для Екатеринбурга. Не ждите, пока станет хуже.

  5. Если у пациента есть тяжелые сердечно-сосудистые болезни, психозы, судорожный синдром или подозрение на смешанное отравление, домашняя капельница может быть ограничена по возможностям. В стационаре доступны более широкая диагностика, круглосуточная линия дежурной помощи и палаты для контроля динамики. Это особенно важно, когда вывод из запоя осложнен сопутствующей патологией.
    Дополнительная информация – [url=https://kapelnica-ot-zapoya-v-moskve77.ru/]вызов врача на дом капельница от запоя[/url]

  6. Discovering the excellent gaming site can frequently seem seeking a challenging chore, especially with plenty of alternatives present at present [url=https://spin-granny-casinoreview.net]live casino[/url] . If you want a solid guide to traverse the realm of online gambling, the website spin-granny-casinoreview.net serves as a comprehensive tool for enthusiasts of various experience levels. As a focused online casino review portal, it delivers detailed insights concerning the tools, rewards, and privacy systems that shape contemporary best gambling platforms.

    When you enter Spin Granny, you quickly get greeted by a intuitive interface created to help you form calculated selections. The main aim of the webpage is to dissect numerous providers to determine if they really live up to their promises. By reading an expert online casino review on this hub, you may discover regarding essential aspects like cashout velocity, authorization, and support quality. This promises that your valuable time and capital are invested on portals that prioritize fairness and clarity.

    The range of gaming games is a significant emphasis for the destination. Whether you prefer classic slot machines or elaborate table games, the hub features a wide collection of casino games to match all preference. For those who desire the vibe of a land-based establishment, the specialized section on live casino sessions is very helpful. It highlights how these venues deliver professional dealers directly to your interface, building an immersive atmosphere that connects the space between domestic gaming and physical casinos.

    In the end, spingranny intends to streamline your exploration task by spotlighting just the extremely reputable brands. Instead of risking your funds on mysterious websites, you can depend on the verified data provided here. By reviewing the in-depth breakdowns at spin-granny-casinoreview.net, you acquire the belief required to experience your chosen interest securely. Whether you might be a novice or a pro gamer, the authoritative counsel located on this page will enable you discover your subsequent ideal online casino spot.

  7. This Winaura website has emerged as a favourite option for internet betting lovers searching a effortless and engaging venture [url=https://winaura-46.onrender.com]casino winaura[/url] . Known for its win aura casino offerings, WinAura provides a modern and player-focused dashboard that caters to both relaxed bettors and experienced gamblers. Whether you’re exploring winaura online or looking for a trusted winaura betting platform, this platform excels for its accessibility and selection of entertainment.

    A key aspect of WinAura is its winaura live casino area, which offers real-time gaming experiences with seamless transmission and dynamic elements. This ensures players can enjoy their beloved table games, such as twenty-one, wheel of fortune, and the game of the bank, with the energy of live dealers. The site’s WinAura online casino services also include a extensive range of slot machines, poker, and other trendy entertainment, making it a flexible choice for those seeking fun.

    For players new to the site, winaura official verification is essential to ensure legitimacy and security. Winora focuses on user protection by applying robust encryption and fair gaming practices, which is vital for maintaining trust in the online betting scene. The website’s intuitive design and adaptive structure additionally improve the gaming pleasure, making it a exceptional selection among winaura casino alternatives.

    Whether you’re interested in WinAura casino deals or simply looking for a reliable winaura online casino, this platform provides a harmonious mix of entertainment and equity. With its commitment to delivering a effortless and enjoyable gaming experience, Winaura continues to win over gamblers who appreciate both enjoyment and consistency in their virtual wagering choices.

  8. Рекомендации строятся вокруг состояния человека, а не по универсальному шаблону для всех случаев.
    Подробнее – [url=https://narcolog-na-dom-voronezh017.ru/]https://narcolog-na-dom-voronezh017.ru[/url]

댓글 달기

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