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”의 96,026개의 댓글

  1. Вызов нарколога на дом позволяет начать лечение без самостоятельной поездки пациента в клинику. Такая услуга востребована при длительном запое, выраженной алкогольной интоксикации, абстинентном синдроме, наркотической ломке и повторном ухудшении самочувствия. Врач приезжает домой по указанному адресу в Воронеже, проводит осмотр пациента, уточняет жалобы и собирает медицинские данные. Уже на месте нарколог определяет, возможно ли лечение дома или безопаснее продолжить его в клинике.
    Изучить вопрос подробнее – [url=https://narcolog-na-dom-voronezh018.ru/]вызвать нарколога на дом[/url]

  2. The Winaura platform is a highly regarded digital entertainment hub that has attracted considerable interest among players looking for an engaging and profitable experience [url=https://win-aura-45.jacinthfxstolteneha60.workers.dev]winaura[/url] . Famous for its diverse array of games and attractive bonuses, the Winaura platform provides a effortless way to enjoy virtual casino excitement from the ease of your home. Whether you’re a enthusiast of slots, blackjack, or interactive experiences, the Winaura platform offers a platform that meets every taste.

    One of the notable highlights of the Winaura platform is its intuitive layout, making it accessible for all newcomers and seasoned enthusiasts. The site ensures a optimal gaming journey with high-quality graphics and rapid processing, which is vital for maintaining enthusiasm. Players can enjoy a selection of games, featuring popular titles from top-tier software developers, ensuring excitement in all playthrough.

    For those looking to optimise their gaming session, the Winaura platform frequently launches bonuses and rewards that increase winnings. These can range from first-deposit bonuses, free spins, and member benefits, making it a appealing option for those who love a little incentive. The platform’s focus to fairness is also a major selling point, as players can rely on the fact that their games are conducted with ethics.

    If you’re looking for the legitimate Winaura portal, it’s essential to verify you’re connecting to a genuine and secure site. Win Aura prioritises protection by implementing advanced security protocols, such as secure protocols to shield personal and financial details. This dedication to protection assists establishing faith among its user base, making it a reliable option for digital betting lovers.

    Real-time gaming games on the Winaura platform are particularly trending, offering an captivating experience that authentically mimics the ambience of a physical casino. The integration of real-time streaming and professional hosts introduces an further layer of credibility, making it a key element for those who appreciate the social and dynamic aspects of real-time gaming.

    No matter whether you’re exploring Winaura for the first occasion or visiting again for further entertainment, the platform keeps to develop, introducing new games and updates to ensure the journey fresh and enjoyable. With its mix of ease of use, variety, and user-focused policies, this site is a solid player in the competitive scene of online casinos.

  3. Домашний вызов нарколога подходит в тех случаях, когда человеку требуется медицинская помощь, но поездка в клинику затруднена или нежелательна. Причиной обращения может стать длительный запой, тяжелое похмелье, абстинентный синдром, наркотическая ломка, ухудшение самочувствия после употребления психоактивных веществ или повторный срыв. Специалист приезжает по адресу в Воронеже, проводит первичный осмотр, уточняет анамнез и определяет, можно ли безопасно оказать необходимую помощь дома.
    Получить больше информации – [url=https://narcolog-na-dom-voronezh016.ru/]вызов нарколога на дом Воронеж[/url]

  4. Обращение в центр может начинаться с консультации, телефонного звонка или заявки через сайт. Пациент или родственники могут бесплатно уточнить формат приема, условия стационара, доступные услуги, стоимость и возможность вызвать врача. Если человек хочет сохранить конфиденциальность, лечение в частной клинике можно организовать анонимно. Медицинская помощь доступна при зависимости, которая продолжается несколько месяцев, 2 года, 5 лет, 10 лет, 15 лет, 20 лет и дольше.
    Ознакомиться с деталями – [url=https://narkologicheskaya-klinika-voronezh17.ru/]наркологическая клиника наркологический центр в Воронеже[/url]

  5. winaura-stapist

    WinAura Gaming is a rising entity in the online gambling sector, providing gamblers an immersive and exciting venture through its site [url=https://winaura-45.vercel.app]winaura official[/url] . Renowned for its elegant design and easy-to-navigate platform, WinAura has fast gained traction among those searching for a dependable digital betting site.

    Whether you’re discovering to experience interactive gambling, try out classic slot machines, or wager bets on matches, WinAura provides a wide selection of options to cater to diverse tastes.

    One of the notable highlights of WinAura Gaming is its focus to providing a smooth playing experience. The platform ensures smooth gameplay with minimal lag, thanks to its enhanced hosting and superior transmission technology. This ensures that it particularly desirable for lovers of real-time gambling, where instant communication with croupiers and fellow players is crucial. Whether you’re playing in twenty-one, the wheel, or punto banco, WinAura’s live casino section delivers an realistic and entertaining environment.

    For those new to the website, WinAura Casino also creates a inviting environment with lucrative promotional offers. First-time users can often enjoy promotional deals that comprise bonus rounds, matching bonuses, or refund offers, ensuring that easier to begin their betting adventure with added benefits. Moreover, the website frequently refreshes its promotions, ensuring that dedicated users always have an incentive thrilling to anticipate.

    Outside of real-time gambling, WinAura Gaming’s digital gaming hub also hosts a wide array of slot machines, table games, and betting options. The platform partners leading game developers to offer premium titles with honest odds and thrilling designs. This diversity ensures that players can locate something that fits their taste, whether they prefer classic titles or the newest releases from popular developers.

    WinAura’s standing as an licensed and trustworthy site is another key element in its fame. The website focuses on security by using robust protection protocols, including encryption technology to safeguard user and monetary information. This commitment to clarity and fairness helps build confidence among its audience, ensuring that it a go-to choice for those looking for a authentic digital gambling journey.

    Whether you’re a experienced player or a first-timer to digital gambling, WinAura Gaming offers a comprehensive site that combines excitement, convenience, and reliability. With its focus on real-time betting, lucrative bonuses, and a wide selection of betting options, it keeps to entice users hunting an enjoyable and profitable venture. Exploring WinAura’s offerings might be the upcoming action in boosting your betting adventure.

  6. Выездная наркологическая помощь позволяет начать лечение без поездки в стационар и лишнего стресса для человека. В зависимости от показаний услуги могут включать консультацию, вывод из запоя, детоксикацию, капельницу, снятие абстинентного синдрома и рекомендации по дальнейшему лечению зависимости. Если состояние пациента требует постоянного контроля, нарколог предлагает продолжить лечение в клинике. Решение принимается после оценки, поскольку дом подходит не для всех случаев алкогольной или наркотической интоксикации.
    Узнать больше – [url=https://narcolog-na-dom-voronezh015.ru/]вызвать нарколога на дом в Воронеже[/url]

  7. The writing style in this post feels very easygoing and approachable, since the ideas are explained in a well-organized and organized way that keeps readers interested while also encouraging thoughtful interaction in the comments.

    online casino deutschland

댓글 달기

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