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”의 70,987개의 댓글

  1. В данной публикации мы поговорим о процессе восстановления от зависимости, о том, как вернуть себе нормальную жизнь. Мы обсудим преодоление трудностей, значимость поддержки и наличие программ реабилитации. Читатели смогут узнать о ключевых шагах к успешному восстановлению.
    См. подробности – [url=https://furnipro.info/publ/kak_sdelatj_mebeli/raznoe/kodirovanie_ot_alkogolizma_shag_k_trezvosti/9-1-0-1852]Нарколог кодирование от алкоголизма[/url]

  2. В этой статье рассматриваются способы преодоления зависимости и успешные истории людей, которые справились с этой проблемой. Мы обсудим важность поддержки со стороны близких и профессионалов, а также стратегии, которые могут помочь в процессе выздоровления. Научитесь первоочередным шагам к новой жизни.
    Кликни и узнай всё! – [url=https://housefindr.ru/pages/vyezd-vracha-narkologa-na-dom-anonimno/]доктор нарколог вывод из запоя на дому[/url]

  3. Этот текст посвящён сложным аспектам зависимости и её влиянию на жизнь человека. Мы обсудим психологические, физические и социальные последствия зависимого поведения, а также важность своевременного обращения за помощью.
    Узнать напрямую – [url=https://berezniki.su/news/health/kak-zakodirovatsya-ot-alkogolya-vyzov-narkologa-na-dom-vsyo-chto-nuzhno-znat]наркологическаяклиникадельта[/url]

  4. В данной статье рассматриваются проблемы общественного здоровья и социальные факторы, влияющие на него. Мы акцентируем внимание на значении профилактики и осведомленности в защите здоровья на уровне общества. Читатели смогут узнать о новых инициативах и программах, направленных на улучшение здоровья населения.
    Ознакомьтесь поближе – [url=https://autohirebuy.ru/pages/narkologicheskaya-pomosch-na-domu-bez-postanovki-na-uchet/]вызвать нарколога на дом без постановки на учет[/url]

  5. В этом исследовании рассмотрены методы лечения зависимостей и их эффективность. Мы проанализируем различные подходы, используемые в реабилитационных центрах, и представим данные о результативности программ. Читатели получат надежные и научно обоснованные сведения о данной проблеме.
    Узнать напрямую – [url=https://medvkostrome.ru/kodirovanie-ot-alkogolizma-chto-eto-takoe-i-kak-vybrat-svoj-put-k-trezvosti/]кодирование от алкоголя[/url]

  6. When you are searching for a thrilling approach to challenge your luck, the Plinko game has emerged as a huge hit for local users [url=https://plinko-94.onrender.com]Plinko casino[/url] . This virtual iteration of the timeless amusement adventure is currently ready at the website found at plinko-94.onrender.com. Many participants regularly query what is Plinko game and why it has secured so much popularity. Clearly explained, it is an electrifying casino-style adventure where you drop a Plinko ball from the crest of a pyramid, viewing it bounce off pins until it rests in a bonus slot at the bottom.

    As you discover the Plinko game online, you will discover that the gameplay are incredibly intuitive. Understanding how to play Plinko is uncomplicated: you select your bet, adjust your danger setting, and click play to release the ball. The directness of the Plinko casino game is exactly what makes it so captivating. For those keen in the excitement of possible winnings, playing Plinko game online real money options provides an adrenaline-pumping encounter that makes players recurring.

    A frequent question within beginners is, is Plinko legit? When participating in any kind of Plinko gambling, it is crucial to utilize reliable platforms that verify fair play. The edition hosted at the mentioned site features a slick interface that mimics the logic seen on major platforms like bc game Plinko, making it simple for both novices and veteran players to operate. The beauty of the Plinko casino experience exists in the excitement of where the ball will land. If you are targeting for high-risk multipliers or consistent, minor wins, Plinko presents a adaptable gaming experience that matches every wallet.

    As you dive into the world of Plinko, remember to define limits and enjoy the game wisely. The aesthetic charm and the gratifying noise of the ball hitting the pegs create this one of the very fun means to pass your free time. Check the site now to discover why this classic game has transitioned from screen fame to becoming a fixture of recent online entertainment in Nigeria.

  7. chickenroad-gairee

    Al momento que optas por descubrir el sector de las apuestas virtuales, se vuelve esencial captar las directrices que rigen tu vivencia [url=https://chickenroad-reviewgame.es/terminos-y-condiciones]ChickenRoad[/url] . En la web oficial de Chicken Road, la honestidad es un valor clave, y precisamente por esto es preciso leer detalladamente el apartado del acuerdo legal presente en el portal que apunta a ChickenRoad. formal no solo protege a la plataforma, sino que tambien otorga a los miembros el respaldo necesaria para disfrutar de su propuesta de manera responsable y equitativa.

    Al entrar en el sitio de Chicken Road, aceptas obligarte a aceptar un conjunto de reglas que gestionan el comportamiento dentro del entorno de juego. Dichas estipulaciones engloban temas vitales como la elegibilidad del jugador, certificando que la totalidad de miembros cumplan con los limites de edad fijados por la legalidad. Sumado a esto, el archivo detalla de forma clara las facultades de propiedad intelectual, el empleo debido de las herramientas facilitadas por ChickenRoad y los procedimientos necesarios para administrar tu cuenta con garantias.

    Resulta relevante tener presente que la navegacion de algun servicio relacionado con Chicken Road implica la conformidad total de dichas normas. Debido a esto, recomendamos encarecidamente emplear unos minutos a repasar los apartados vitales que se presentan en su web principal. Entender estas directrices colabora a prevenir problemas sobre el uso de la web, el tratamiento de datos personales y las politicas de privacidad que protegen tu anonimato en tus ratos libres.

    El sistema ChickenRoad se dedica por mantener un marco igualitario, y sus terminos y condiciones son la columna vertebral que posibilita que los usuarios trabaje sin problemas. Si llegado el caso brotan interrogantes sobre los servicios proporcionados, el contrato actuara como la guia definitiva para despejar toda duda. Al estar bien informado, garantizas una partida de mayor calidad, sumamente honesta y, fundamentalmente, absolutamente fiable dentro del ecosistema de Chicken Road. Seguir al tanto con las actualizaciones de estas directivas es el metodo ideal de gozar plenamente de todo lo que el sitio dispone para ti hoy en dia.

  8. The latest Casino has become a favourite online gaming destination, offering a wide selection of casino games, including slots, table options, and real-time dealer experiences [url=https://surge-casino.onrender.com]surge casino login[/url] . Whether you’re a seasoned player or completely new to online casinos, The platform provides a straightforward interface and a variety of bonuses to boost your gaming experience. With its modern design and seamless performance, it’s totally expected that players are increasingly turning to this platform for fun.

    One of the standout features of The Casino is its massive library of Surge slots games. From traditional fruit games to high-tech video slots with immersive themes and high-stakes special features, there’s something for any taste. The site ensures a flawless gaming experience with top-tier graphics, buttery-smooth animations, and transparent gameplay. Whether you enjoy story-driven adventures, progressive jackpots, or fast-paced games, the The Casino’s slots range suits every preferences.

    For those wanting to begin their journey, accessing Surge Casino is straightforward. The registration journey is fast and straightforward, requiring only a few of details to create an profile. Once logged in, players can explore bonuses like The Casino’s complimentary spins, which are often available upon sign-up or as part of special deals. These free spins allow new players to try out options without risking their own funds, making it a perfect way to get a feel for the platform’s features.

    Another key aspect of Surge Casino is its dedication to honest play and safety. The platform uses encrypted servers to shield player data, ensuring that transactions and private information remain private. Additionally, Surge Casino’s payout procedures are built to be speedy and hassle-free, allowing players to access their earnings instantly. Whether you prefer bank deposits, e-wallets pockets, or digital currencies, the withdrawal choices are versatile and handy.

    New players can also take advantage from Surge Casino’s sign-up perks, which often include deposit bonuses, refund rewards, or exclusive freebies. These rewards make it even more attractive to sign up for the platform and begin playing immediately away. Whether you’re looking for The Casino’s slot options or other casino classics, Surge Casino offers a complete gaming experience with a emphasis on player satisfaction.

    In conclusion, The Casino stands out as a reliable and fun digital gaming destination. With its wide range of Surge Casino’s slot options, easy Surge Casino login, and generous promotions like free spins, it’s an excellent option for all relaxed and serious players. Whether you’re playing for entertainment or chasing major prizes, the platform ensures a seamless and enjoyable journey.

  9. В этой статье мы подробно рассматриваем проверенные методы борьбы с зависимостями, включая психотерапию, медикаментозное лечение и поддержку со стороны общества. Мы акцентируем внимание на важности комплексного подхода и возможности успешного восстановления для людей, столкнувшихся с этой проблемой.
    Посмотреть всё – [url=https://stomatologist.org/tsentr-kodirovaniya-ot-alkogolizma-kak-eto-rabotaet-i-na-chto-obratit-vnimanie/]Медикаментозное кодирование от алкоголизма[/url]

댓글 달기

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