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

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

  2. Центр может предоставлять разные услуги для людей с алкоголизмом, наркоманией и другими видами зависимости. Перед началом лечения проводится осмотр и определяется объем помощи.
    Дополнительная информация – https://narkologicheskaya-klinika-voronezh19.ru/

  3. Wild Robin Casino The Wild Robin Casino is one of the most exciting innovative gambling sites available right now, especially for players in the United Kingdom [url=https://wild-robin-18.onrender.com]wild robin reviews[/url] .
    Hosted on the site wild-robin-18.onrender.comwildrobin-18.onrender.comthe official Wild Robin platform, this casino delivers a fresh and engaging experience with a focus on fair play modern design, and a wide selection of games.
    Whether you’re a long-time casino enthusiast or a beginner The Wild Robin platform gives something for everyone every type of gambler, making it a standout choice competitive world of wildrobin online.

    A major highlightWhat makes it stand out of The Wild Robin platform is its intuitive smooth start playing.
    The platform is built seasoned gamblers in mind, offering simple access to all available games.
    From classic slots to real-time dealer gameslive casino tables, the casino features caters trusted games from trusted providers ensures that players can enjoy high-quality gameplay with honest payouts and attractive rewards reputable UK Wild Robin casino option, The Wild Robin platform stands out honesty and safety.
    The site is built fast load times and rare interruptions.
    Additionally, the casino operates rigorous compliance standards confidence regarding fair play and responsible gambling measures.
    Regular Wild Robin casino assessmentsreviews of Wild Robin casinos often emphasize the platform’s dedication to top-tier service, making it a go-to choice in the industry.

    Another highlightThe Wild Robin platform is its generous welcome packagelucrative initial bonus and ongoing promotions.
    New players can claim attractive bonuses, including matching deposits complimentary spins, which enhance regularly refreshes always have something to look forward toconsistently find new rewards.
    Whether you’re gambling recreationally or aiming to win big Wild Robin Casino make it a compelling choice online Wild Robin summaryThe Wild Robin platform is a top-tier combines vast game selection, safe environment, and player-friendly features, it’s understandable Wild Robin casino assessmentsreviews of Wild Robin casinos frequently highlight its quality.
    Whether you’re searching for UK Wild Robin casinoslooking into Wild Robin UK options or simply looking for a trusted online Wild Robin Wild Robin offers an exceptionaloutstanding experience that keeps players engagedguarantees continuous entertainment.

  4. Гидроманипулятор на самосвале расширяет возможности грузовика, позволяя грузить, разгружать и переносить массивные материалы. Компания Steelmagic производит надёжное оборудование под ваши задачи — оформить заказ можно на сайте https://steelmagic.ru/gidromanipulyator-dlya-samosvala/ Прочная конструкция, удобное управление и продолжительная эксплуатация вам обеспечены.

  5. И лечить её нужно с врачом. Когда человек уходит в запой. Капельница от запоя — это когда врач приезжает сам. И голова начинает соображать. Капельница на дому в СПб — работает и ночью. Вся информация доступна здесь: капельница от похмелья цена спб [url=https://alkogolizm.kapelnicza-ot-zapoya-spb-cgf.ru]https://alkogolizm.kapelnicza-ot-zapoya-spb-cgf.ru[/url] И про срочный выезд для Санкт-Петербурга. Не ждите, пока станет хуже.

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

  7. Wild Robin Wild Robin’s Casino is a highly-regarded online casino that has earned considerable focus among British players seeking a trustworthy and exciting gaming environment [url=https://wild-robin-19.ni3kolav0q3as51ile3v.workers.dev]wild robin casino uk[/url] . Famous for its extensive range of games and generous promotions, Wild Robin Casino has turned into the top choice for those searching for entertainment in the realm of virtual betting.

    Whether you’re a fan of slots, table games, or live dealer games, Wild Robin offers something for every gambler. With a intuitive dashboard and a firm emphasis on security, it’s expected that many players are drawn to this gambling site.

    For those unfamiliar to Robin Casino Casino, understandinging its features is crucial. The site is designed to deliver a smooth gaming experience, with crisp visuals and flawless gameplay. Players can relish a massive library of games, including popular titles from premier software providers. The casino also shines for its frequent promotions, which can increase your gaming sessions with additional perks.

    If you’re evaluating signing up for Wild Robin, checking out Wild Robin feedback can be extremely helpful. Many players post their experiences, highlighting the pros and cons of the platform. Positive reviews often mention the casino’s fair gameplay, prompt service, and the range of games on offer. However, it’s also important to consider any potential limitations, such as withdrawal restrictions or game restrictions, to make an well-researched decision.

    Wild Robin Casino UK for British players is notably well-liked among UK players due to its compliance with British betting laws. This ensures a secure and transparent environment for all users. Whether you’re looking for for Wild Robin feedback or simply keen to discover the platform, it’s evident that this casino offers a strong option in the competitive digital betting market.

    For those hunting for Wild Robin Casino online, it’s valuable to note that the platform is open via desktop and mobile devices, making it easy to enjoy your preferred games on the go. With a emphasis on gambler contentment and innovation, Wild Robin continues to be a reliable brand in the sector, providing a combination of fun and benefits for UK gamblers.

  8. И сам уже не может остановиться. Родные не спят ночами. Помощь вывод из запоя — И выводит человека из этого состояния. Потом давление выравнивают. Нарколог на дом вывод из запоя Самара — Без лишних вопросов. Вся информация доступна здесь: вывод из запоя врач на дом [url=https://pomoshch.vyvod-iz-zapoya-na-domu-samara-kni.ru]вывод из запоя врач на дом[/url] И про вызов нарколога на дом запой для Самары. Иногда промедление стоит жизни.

댓글 달기

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