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”의 95,989개의 댓글

  1. Winaura is a growing entity in the online gambling and gaming sector, offering gamblers a cutting-edge and thrilling site to play their favourite betting options [url=https://win-aura-42.pages.dev]winaura online casino[/url] . Known for its sleek interface and wide range of wagering opportunities, Winaura has fast earned momentum among both relaxed and seasoned gamblers. Whether you’re looking to dive into Winaura or dive into live casino experiences, this site delivers a effortless and engaging experience.

    One of the notable aspects of Winaura is its dedication to providing a smooth user experience. The site is designed with usability in mind, ensuring that players can easily navigate betting options. For those new to the environment, The Casino’s accounts often emphasise the convenience of sign-up and the variety of deposit choices, making it easy for users to start their betting experience.

    If you’re interested about Winaura, you’ll come across a wide range of choices, from classic gaming games like slot machines and wheel games to real-time experiences. The live casino feature of winaura is particularly favoured, as it delivers live interaction with hosts, adding an additional touch of engagement. Whether you like the excitement of The Casino’s digital slots or the tactical depth of table betting, the environment serves wide tastes.

    For those looking for a trustworthy and honest session, The Casino digitally is designed with security and transparency in focus. The site follows to strict laws, making sure that all betting are equitable and honest. This dedication to ethics makes it a preferred selection for players searching a legitimate winaura session.

    Special offers and incentives are one of the notable draw of winaura. The site regularly updates its deals, including first-deposit rewards, bonus spins, and exclusive benefits, which boost the entire entertainment experience. Whether you’re a new player or a returning user, these perks ensure appealing for those dipping into the domain of virtual casinos.

    In conclusion, Winaura shines as a complete site that merges excitement, ease, and fairness. Whether you’re eager in winaura online slots, live dealer betting, or simply exploring fresh betting opportunities, this site delivers a dynamic and thrilling space for all categories of gamblers. With its intuitive layout and commitment to standards, The Casino continues to expand as a beloved entity in the online gambling industry.

  2. Помощь оказывают врачи с практикой в наркологии, психиатрии и восстановительной терапии.
    Дополнительная информация – [url=https://narkologicheskaya-klinika-voronezh19.ru/]частная наркологическая клиника[/url]

  3. uvГ­tacГ­ bonus bez vkladu casino vstupny bonus bratislava novГ© ДЌeskГ© online casino bonus za registrГЎciu Free spin bonus automaty hry zdarma riche hry automaty zdarma stiahnut

  4. Winaura is a well-known digital entertainment hub that has gained massive interest among players searching for a effortless and thrilling gaming journey [url=https://win-aura-43.vercel.app]winaura casino[/url] . Famous for its user-friendly design and diverse array of entertainment, Winaura has become the top choice for those wishing to partake in Winaura’s digital casino without the hassles of traditional physical casinos. Whether you’re a seasoned player or a first-timer to online betting, Winaura provides a welcoming space where entertainment combines with ease.

    One of the key features of Win Aura is its focus to delivering a winaura online experience that is both safe and thrilling. The site guarantees fair gameplay through comprehensive testing and compliance with sector standards, providing users trust in their stakes. With a extensive choice of entertainment, including slot games, table games, and real-time casino opportunities, Winaura suits to different preferences, making it a flexible choice for fans of Winaura’s gambling.

    For those interested to dive the thrill of real-time playing, Winaura features a winaura live casino experience that brings the excitement of a physical gambling den directly to your machine. The high-definition transmission and live communication with dealers build an engaging environment, allowing gamblers to engage in games like 21, roulette, and chemin de fer with simplicity. Whether you’re gambling from your computer or mobile screen, the site guarantees smooth performance and minimal latency, boosting the overall playing session.

    Winaura also stresses ease of use, making it easy for gamblers to browse the platform and process deposits or cashouts quickly. The platform accepts multiple payment methods, covering crypto, guaranteeing that deals are both safe and easy. This flexibility is particularly appealing to those who choose the Winaura digital gambling journey without the demand for conventional financial methods.

    As an official site, Win Aura focuses transparency and player contentment, providing rewards and promotions tailored to enhance the playing journey. From welcome deals to continuous rewards, users can appreciate bonus worth while discovering the diverse range of entertainment available. Whether you’re drawn to the thrill of slots or the mental challenge of desk games, Win Aura offers a balanced session that suits to all preferences.

    In brief, Win Aura shines out as a reliable and thrilling spot for online gaming, providing a seamless combination of fun, safety, and accessibility. Whether you’re hunting to test your fortune at a Winaura digital gambling den or dive the thrill of live playing, this site delivers an engaging session that ensures gamblers revisiting for additional. With its intuitive design and focus to fair gambling, Winaura remains to be a top pick for those hunting the best in winaura online gaming.

  5. Общаемся без осуждения и давления, сохраняя спокойную атмосферу для пациента и семьи.
    Дополнительная информация – [url=https://vivod-iz-zapoya-voronezh16.ru/]врач вывод из запоя Воронеж[/url]

  6. Информация об обращении не передается третьим лицам, а детали лечения обсуждаются только с пациентом.
    Изучить вопрос подробнее – [url=https://narkologicheskaya-klinika-moskva15.ru/]наркологическая больница москвы[/url]

  7. Информация об обращении не передается третьим лицам, а детали лечения обсуждаются только с пациентом.
    Узнать больше – [url=https://narkologicheskaya-klinika-balashiha.ru/]chastnye-narkologicheskie-kliniki-v-balashihe[/url]

댓글 달기

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