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

  1. If you happen to be looking for a premier gambling destination that merges traditional amusement with up-to-date convenience, the website at golden-lion-4.pages.dev stands out as a significant platform [url=https://golden-lion-4.pages.dev]goldenlion casino[/url] . Plenty of users regularly search for a detailed golden lion casino review to comprehend what makes this provider operate. As you navigate the interface, you will quickly realise that the golden lion adventure is designed to serve both relaxed players and high rollers also. When executing a rigorous goldenlion review, it is vital to concentrate on the selection of pokies, card games, and the overall stability of the system.

    The fame of goldenlion casino continually grow within virtual betting enthusiasts. Whether you are searching for an immersive adventure or just desire to test your odds at the latest release titles, the golden lion online platform offers a seamless journey from sign-up to cash-out. Several members choose this specific casino goldenlion due to its simple structure and handheld optimisation, which permits betting while travelling. When you visit casino golden lion, you are met by a polished section that highlights player enjoyment, verifying that any round is both enjoyable and secure.

    Locating a trusted goldenlion casino online can often appear overwhelming considering the sheer number of options present. Yet, the steady favourable comments seen in any goldenlion review spotlight the company’s dedication to honest play and user contentment. The golden lion label has successfully develop a loyal following by providing diverse incentives and a robust library of games that keeps players returning. By choosing to gamble at goldenlion, you are opting for a play atmosphere that prizes honesty and top-notch graphics. Before you start your experience, taking a short moment to examine the attributes of the portal guarantees you are fully ready to maximise your gaming. If you value a sophisticated virtual casino journey that places the user ahead, this site is surely worth your attention. Check out the selections right now and see why this site stays a popular choice for gamblers everywhere.

  2. Помощь может включать консультацию, детоксикацию, стационар и дальнейшее сопровождение по показаниям.
    Дополнительная информация – [url=https://vyvod-iz-zapoya-krasnoyarsk70.ru/]нарколог на дом вывод из запоя в Красноярске[/url]

  3. В данном обзоре представлены основные направления и тренды в области медицины. Мы обсудим актуальные проблемы здравоохранения, свежие открытия и новые подходы, которые меняют представление о лечении и профилактике заболеваний. Эта информация будет полезна как специалистам, так и широкой публике.
    Кликни и узнай всё! – [url=https://pillow.su/medikamentoznyj-vyvod-iz-zapoya-effektivnyj-sposob-vosstanovleniya/]наркологическаяклиникадельта в рязани[/url]

  4. Безопасный вывод токсинов из организма — первый и важнейший этап лечения в любой наркологической клинике. В Екатеринбурге процедура детоксикации проводится под круглосуточным контролем врачей, что минимизирует риски осложнений. Использование современных методов позволяет быстро нормализовать работу внутренних органов и систем, снизить выраженность синдрома отмены.
    Получить дополнительные сведения – [url=https://narcologicheskaya-klinika-ekaterinburg00.ru/]наркологическая клиника[/url]

  5. декларация ТР ТС Необходимый **сертификат ТР ТС** подтверждает безопасность оборудования, одежды, продуктов питания и других категорий товаров. Пройдите испытания в аккредитованной лаборатории без проблем.

  6. В данном материале представлены ключевые тенденции в сфере медицинской науки и практики. Вы узнаете о последних открытиях, инновационных подходах к терапии и важности профилактики заболеваний. Особое внимание уделено практическому применению новых методов в клинической практике.
    Исследовать вопрос подробнее – [url=https://housefindr.ru/pages/narkolog-na-dom-stoimost/]психиатр нарколог на дом[/url]

  7. goldenlion-Obenia

    Whilst searching for a top-tier gaming adventure, many players are directing their focus to the golden lion platform [url=https://goldenlion-5.vercel.app]goldenlion review[/url] . Being a emerging star in the virtual gaming space, the goldenlion casino offers a refined environment customised for those who value premium slots, engaging table games, and a smooth interface. Assuming you are searching for a trustworthy destination, our detailed goldenlion casino review suggests that this site is quickly evolving into a preferred for fans within the UK.

    The appeal of the golden lion online session sits in its dedication to player satisfaction. Starting the second you reach on the hub, you are welcomed by an intuitive design that highlights simplicity of browsing. Whether you are opening the platform using computer or mobile, the goldenlion casino online layout ensures that your preferred games are constantly readily available. Players who have spent the effort to post a goldenlion review often highlight the impressive range of genres and the integrity of the betting mechanics.

    Which factor truly sets this casino golden lion apart from its rivals is the combination of safety and fun. By focusing on a safe infrastructure, the goldenlion brand provides tranquillity as you investigate their vast library. Numerous players searching for a casino goldenlion session enjoy the routine refreshes and new content that keep the platform feeling dynamic and thrilling. Even if you are a seasoned player or a novice to the world, the golden lion environment is engineered to cater to various levels of skill.

    In summary, if you are looking for a portal that weighs artistic beauty with practical excellence, the goldenlion portal is certainly worth your time. Our goldenlion casino review verifies that the site delivers on its assurances, offering a secure, interesting, and modern environment for online gaming. Investigate the features for you and uncover why so plenty of individuals are performing the change to the golden lion. It is time to improve your strategy and see how this operator is making such a major impact on the industry.

  8. В этой статье рассматривается комплексный подход к избавлению от зависимости. Читатель узнает, как сочетание физического, психологического и духовного восстановления помогает достичь стойкого выздоровления.
    Открой скрытое – [url=https://formyangel.ru/narkolog-na-dom-praktichno-bezopasno-i-po-chelovecheski-chto-nuzhno-znat-pered-vyzovom/]наркологическая клиника Дельта в Балашихе[/url]

  9. В каждом клиническом случае программа лечения формируется индивидуально. Специалисты учитывают стаж зависимости, возраст, результаты анализа, состояние печени и других органов, психические нарушения, отношение пациента к лечению и поддержку семьи. Если близкий пьет несколько дней или употребляет наркотики, родственникам важно не заниматься самостоятельным подбором препаратов. Врач определяет безопасное лечение после осмотра и выбирает методы, соответствующие текущей ситуации.
    Получить больше информации – [url=https://narkologicheskaya-klinika-balashiha.ru/]kruglosutochnaya-narkologicheskaya-klinika[/url]

  10. Информация об обращении не передается третьим лицам, а детали лечения обсуждаются только с пациентом.
    Дополнительная информация – [url=https://4.vyvod-iz-zapoya-balashiha13.ru/]vyvod-iz-zapoya-s-vyezdom[/url]

댓글 달기

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