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”의 79,957개의 댓글

  1. spinogambino-Stind

    Jestlize shanite moderni a vzrusujici misto pro online sazky, Spinogambino představuje jednu z nejzajimavějsich voleb na současnem trhu [url=https://spinogambino-casino.cz]spinogambino[/url] . Tato platforma si rychle ziskala oblibu mezi hrači diky sve rozsahle nabidce her, intuitivnimu rozhrani a atraktivnim bonusům, ktere vylepsuji kazdy herni zazitek. Pokud vas zajima, zda je tento portal tou pravou volbou pravě pro vas, nase podrobna recenze Spinogambino vam poskytne vsechny potřebne odpovědi.

    Spinogambino se zaměřuje na poskytovani spičkoveho servisu pro sve uzivatele. Na Spinogambino official site naleznete siroke portfolio automatů, stolnich her i sekci s zivym casinem, ktere vas vtahne přimo do atmosfery skutečne herny. Hrači, kteři hledaji Spinogambino czech verzi, oceni přehlednost a lokalni přizpůsobeni, diky kteremu je pohyb na webu velmi snadny. Pokud si chcete ověřit, co vsechno toto casino nabizi, stači navstivit stranky a vyzkouset si sve stěsti v siroke skale dostupnych titulů.

    Při psani teto recenze Spinogambino jsme se zaměřili na bezpečnost, platebni metody a kvalitu zakaznicke podpory. Casino Spinogambino klade velky důraz na ochranu dat a ferove hrani, coz potvrzuje i rostouci počet spokojenych uzivatelů. Nase Spinogambino recenze take často vyzdvihuji rychlost vyplat a pravidelne akce, ktere zvysuji sanci na zajimave vyhry. Česti hrači na Spinogambino si navic pochvaluje snadnou dostupnost her přimo z mobilnich zařizeni.

    Celkově lze řici, ze Spinogambino patři mezi spičku ve svem oboru. Pokud je vasi prioritou spolehlivost a zabava, nase recenze Spinogambino vam jen potvrdi, ze registrace na tomto webu dava smysl. Ať uz jste začatečnik nebo zkuseny profesional, casino spino gambino vam otevře dveře do světa nekonečne zabavy. Navstivte tyto stranky dnes a přesvědčte se sami o kvalitach, ktere tato platforma nabizi kazdemu novemu i stalemu členovi. Recenze Spinogambino jasně dokazuje, ze se jedna o stabilniho hrače na trhu, ktery vi, jak sve zakazniky nalezitě odměnit.

  2. Вывод из запоя в Екатеринбурге применяется для прерывания продолжительного приема алкоголя, облегчения абстиненции и восстановления нормальной работы организма. Нарколог оценивает симптомы, длительность запойного периода, возраст, стаж алкоголизма, работу сердца, печени и почек. В зависимости от тяжести помощь можно оказать на дому либо продолжить лечение в стационаре. Основная задача — безопасно вывести зависимого из острого периода и создать условия для дальнейшего лечения алкоголизма.
    Дополнительная информация – [url=https://vyvod-iz-zapoya-v-ekaterinburge24.ru/]вывод из запоя на дому круглосуточно в Екатеринбурге[/url]

  3. Текст посвящён распространённым мифам о зависимости и их развенчанию. Мы предоставим научно обоснованную информацию и дадим рекомендации по выбору эффективного способа борьбы с зависимым поведением.
    Углубиться в тему – [url=https://watertechology.ru/pages/vyvedenie-iz-zapoya-v-bolnice/]вывод из запоя в наркологическом стационаре[/url]

  4. needforslotsbonus-Skigh

    Exploring the landscape of online gaming demands a clear understanding of the guidelines that dictate your session [url=https://needforslotsbonus.net/terms-and-conditions]need for slots[/url] . When you visit NeedForSlots, it is essential to familiarize yourself with the rules of play available via their dedicated portal. These guidelines provide a safety net for each the casino and the player, making sure every gameplay stays fair, transparent, and fun for everyone involved.

    By checking the T&Cs on the NeedForSlots platform, you gain valuable insights into profile settings, withdrawal procedures, and bonus eligibility. Many gamers often overlook this document, however it holds critical information regarding wagering requirements and promotional constraints. Grasping these details helps you choose wisely when activating bonuses or managing your balance. Whether you are a beginner or a pro player, being aware of the specific policies associated with need for slots helps prevent misunderstandings and ensures a better play experience.

    The rules section covers essential topics including ID checks, safe play methods, and profile protection. NeedForSlots prioritizes user safety, and their rules reflect a dedication to keeping a safe space. It is your duty to check these sections regularly, as updates may happen to account for new regulations or platform improvements. Knowing the house rules lets you concentrate on the fun of your favorite titles rather than stressing over surprises.

    If you have inquiries concerning your profile details or specific bonus terms, the NeedForSlots help desk is follows these set rules to provide you with the best possible assistance. Spending some time to review the policy is a smart practice that enhances your general gameplay. By following these rules, you contribute to a great environment. Keep in mind that knowledge is the essential component to smart gaming, and the terms and conditions at this site are built to keep your focus on the fun: on the excitement of the game.

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

  6. В этой статье мы обсудим процесс восстановления после зависимостей, акцентируя внимание на различных методах и подходах к реабилитации. Читатели узнают, как создать план выздоровления и использовать полезные ресурсы для достижения устойчивых изменений.
    Не пропусти важное – [url=https://ihdd.ru/vyzov-na-dom-chastnogo-narkologa]алкоголизм вызов на дом[/url]

  7. needforslotsbonusreview-Sheda

    Traversing the vast universe of internet gambling might often seem intimidating, yet discovering the perfect guide is the key element to a rewarding adventure [url=https://needforslotsbonusreview.net]online casino review[/url] . This is where Needforslots enters into focus. Functioning as a leading hub for players seeking a detailed online casino review, the site acts as a trusted guide in the virtual betting environment. Whether you happen to be a novice discovering your starting platform or a seasoned pro hunting for fresh possibilities, Needforslots offers the insights required to reach smart decisions.

    The portal specializes in analyzing the modern casino games, verifying that every player comprehends the mechanics, themes, plus potential returns ahead of they risk their budget. From intense video slots to the immersive experience of a live casino, the thorough assessment presented helps you select games that suit your individual approach. A primary aspect of the service is its dedication to mobile slots. Because plenty of users migrate to portable devices, understanding the sites offer the finest mobile experience is crucial, furthermore Needforslots stays you informed on the providers supply the slickest experience on the move.

    Outside of game variety, the website is an extremely valuable tool for exploring the complex domain of casino promotions. Everyone loves a welcome bonus, however reading the details is critical. Needforslots simplifies the terms and conditions of all no deposit bonus plus sets of free spins, allowing you to optimize your bankroll effectively. By tracking the current industry trends, the staff guarantees that members are constantly aware of the most profitable offers accessible.

    Selecting the ideal online casino ought to not ever be a matter of chance. With Need for slots, you obtain access to professional reviews that emphasize transparency along with player happiness. By utilizing the platform, you might spend less time searching for trustworthy portals and devoting more moments relishing your preferred gaming titles. If you are ready to elevate your gaming strategy and unlock the greatest rewards in the industry, turn Needforslots your trusted resource for all things connected to your imminent jackpot.

  8. Этот медицинский обзор сосредоточен на последних достижениях, которые оказывают влияние на пациентов и медицинскую практику. Мы разбираем инновационные методы лечения и исследований, акцентируя внимание на их значимости для общественного здоровья. Читатели узнают о свежих данных и их возможном применении.
    Где можно узнать подробнее? – [url=https://boilervdom.ru/zdorove/kapelnica-dlya-alkogolikov.html]капельница выводящая из запоя на дому[/url]

댓글 달기

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