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

  1. Лечение алкоголизма не заканчивается детоксикацией. После вывода из запоя важно продолжить лечение алкогольной зависимости: пройти обследование, обсудить кодирование, психотерапию и реабилитацию. Такая программа помогает не просто пережить запой, а восстановить здоровье и научиться жить без алкоголя.
    Узнать больше – https://vyvod-iz-zapoya-v-ekaterinburge26.ru/

  2. Жена на нервах была. Оказалось, опять сорвался. Капельница от запоя — это когда врач приезжает сам. И голова начинает соображать. Вывод из запоя на дому — И в выходные. Вся информация доступна здесь: прокапаться на дому от алкоголя цена [url=https://narkolog.kapelnica-ot-zapoya-nnovgorod.ru]https://narkolog.kapelnica-ot-zapoya-nnovgorod.ru[/url] Там и про вывод из запоя на дому цена для региона. Обращайтесь к специалистам.

  3. В этой статье рассматривается комплексный подход к избавлению от зависимости. Читатель узнает, как сочетание физического, психологического и духовного восстановления помогает достичь стойкого выздоровления.
    Расширить кругозор по теме – [url=https://drainix.ru/pages/lechenie-zapoya-v-stacionare-moskva/]срочный вывод из запоя в стационаре[/url]

  4. Should you find yourself hunting for a brand new and invigorating gambling portal, the Spino Gambino venue has been gaining traction in the digital gambling scene [url=https://spino-gambino-belgium.com]spinogambino casino review[/url] . As gamers proceed to seek out top-tier entertainment, our detailed Spino Gambino review seeks to analyze specifically what this provider brings to the local market. When navigating the webpage, members will speedily recognize the modern design and the extensive portfolio of rounds that define the Spino Gambino casino experience.

    Perhaps the typical queries from fresh gamblers is if this website is reliable to utilize. Numerous users regularly wonder is Spino Gambino legit before they enroll. Based on our analysis, Spino Gambino online casino sustains top market standards, guaranteeing that punters experience a safe setting. The betting Spino Gambino selection features much from high-stakes pokies to captivating real-time tables, supporting each of relaxed players and high rollers.

    During our Spino Gambino casino review, we investigated the simplicity of use, the quality of player assistance, and the range of transactional tools provided. Spino Gambino online delivers a smooth move from PC to mobile play, implying you can enjoy your favorite slots on the go. If you happen to be focused on the local aspects, the Spino Gambino Belgium portal is adjusted to satisfy native tastes.

    Whenever you conduct a Spino Gambino review, it becomes clear that the portal favors user enjoyment through quick page speeds and an intuitive structure. The Spino Gambino casino hub also regularly refreshes its betting directory, maintaining the experience fresh. If you desire traditional casino games or the newest digital slots, Spino Gambino has proven itself as a trusted selection. Before you start playing, spending a moment to study a thorough Spino Gambino casino review can assist you comprehend the bonus structures and loyalty rewards present. In the end, for players who appreciate reliability and variety, Spino Gambino is a excellent choice in the crowded world of online gaming. Find out why so countless users are deciding to designate this platform their hub for virtual amusement.

  5. At Need for Slots, we value the safety of our players above all else [url=https://need-forslots-bonusapp.net/politika-ochrany-soukromi]need for slots[/url] . Understanding how your personal information is managed is vital when navigating the world of internet gambling sites. Our official privacy policy, located on the Need for Slots platform website, details the exact measures we implement to protect your private data while you enjoy our features. When you use Needforslots, you are entrusting us with your data, and we take that duty seriously.

    The primary goal of our privacy policy is to ensure clarity regarding the collection, storage, and use of your details. Regardless of whether you are using the Need for Slots platform to access bonuses, monitor titles, or adjust your settings, we implement strong encryption standards to keep your details secure from unauthorized access. We only gather information that is strictly necessary to enhance your gaming experience, improve site performance, and offer you with useful gaming news.

    We believe that every player should have peace of mind while using the Needforslots application. Our policy explicitly mentions that we do not trade, sell, or give away your private information to external marketing firms without your direct consent. By upholding rigorous data governance, we guarantee that your experience remains a private and fun experience. Our team at Need for Slots constantly reviews and updates these methods to comply with evolving digital regulations and safety benchmarks.

    If you ever have questions about how your data is handled or if you want to manage your data rights concerning your personal information, our privacy policy provides a comprehensive guide on how to reach our support team. We encourage all players to visit the official policy page on the Need for Slots website to stay informed. By choosing Needforslots, you are choosing a platform that values your privacy as much as your fun. We appreciate you for being a part of our community and for relying on us to safeguard your digital footprint while you explore the best in slot gaming rewards and promotions.

  6. А сам не спит ночами и не выходит из дома. А состояние ухудшается. Платный психиатр на дом — это когда врач приезжает сам. И только после этого становится легче. Психотерапевт на дом Москва — И для детей. Вся информация доступна здесь: психиатр на дом москва [url=https://psikhiatr-na-dom-v-moskve-yhn.ru]психиатр на дом москва[/url] И про консультацию на дому в Москве. Не откладывайте на потом.

  7. В этой медицинской статье мы погрузимся в актуальные вопросы здравоохранения и лечения заболеваний. Читатели узнают о современных подходах, методах диагностики и новых открытий в научных исследованиях. Наша цель — донести важную информацию и повысить уровень осведомленности о здоровье.
    Запросить дополнительные данные – [url=https://botoxexpert.ru/kodirovanie-ot-alkogolizma-v-borisoglebske/]delta clinic ru борисоглебск[/url]

  8. Эта статья подробно расскажет о процессе выздоровления, который включает в себя эмоциональную, физическую и психологическую реабилитацию. Мы обсуждаем значимость поддержки и наличие профессиональных программ. Читатели узнают, как строить новую жизнь и не возвращаться к старым привычкам.
    Эксклюзивная информация – [url=https://cvetnik.me/pages/kapelnica-ot-pohmelya-vyzvat/]капельница снимает похмелье[/url]

  9. Состояние пациента отслеживается на каждом этапе, от первичной консультации до дальнейших рекомендаций.
    Ознакомиться с деталями – [url=https://2.kapelnica-ot-zapoya-v-moskve14.ru/]капельница от запоя клиника[/url]

  10. spinogambinocasino-immary

    Se voce esta em busca de uma plataforma de jogos de primeira linha, o portal Spino Gambino Casino e a referencia que voce precisa conhecer [url=https://spinogambinocasino.com.pt/sobre-nos]spinogambino[/url] . A nossa pagina Sobre Nos revela o compromisso inabalavel que a nossa marca tem com a transparencia, seguranca e entretenimento de cada jogador. No Spino Gambino, acreditamos que o lazer deve ser acompanhado por uma plataforma intuitiva, onde a tecnologia de ponta se encontra com um suporte personalizado e eficiente. Desde o nosso lancamento, temos trabalhado incansavelmente para construir uma base de usuarios fiel, focada em fornecer um ambiente de jogo justo e responsavel. O sucesso do Spino Gambino baseia-se na confianca que depositamos em nossos utilizadores e no rigoroso cumprimento das normas do setor. Valorizamos a honestidade em cada operacao e garantimos que os dados dos nossos membros estejam sempre protegidos por tecnologia de criptografia de ultima geracao. Ao navegar pelo Spino Gambino, descobrira uma enorme variedade de jogos criados pelos melhores provedores da industria, garantindo visuais impressionantes e mecanicas justas. O nosso foco e que o Spino Gambino seja mais do que um site comum; queremos que seja o seu lugar predileto para momentos de diversao e adrenalina. A nossa equipa e composta por profissionais especializados que trabalham diariamente para otimizar os nossos servicos e oferecer ofertas especiais que elevam a sua experiencia. Valorizamos o retorno da nossa comunidade, pois e ele que nos permite crescer e evoluir constantemente. Se procura um site de apostas que priorize a sua satisfacao, seguranca e uma experiencia de jogo autentica, a nossa plataforma e o local perfeito. Convidamos todos os jogadores a explorar o universo do Spino Gambino e a descobrir por que nos tornamos uma referencia absoluta entre os jogadores que nao abrem mao da qualidade. Junte-se a nos hoje mesmo e faca parte de uma trajetoria marcada pela excelencia, diversao e respeito pelo apostador. Seja bem-vindo a experiencia completa que so este site pode proporcionar.

댓글 달기

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