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

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

  2. wildrobin-troula

    Wild Robin casino is an digital entertainment site that has earned interest among English players searching for a trustworthy and exciting playing experience [url=https://wildrobin-casino-8.pages.dev]wild robin[/url] . Renowned for its user-friendly interface and a extensive range of games, Wildrobin provides both traditional slots and interactive dealer alternatives, catering to a broad group of players. Whether you’re a seasoned gambler or a newcomer to online gambling, this hub provides a smooth journey with safe deals and honest entertainment.

    One of the top aspects of Wild Robin is its dedication to transparency, which is demonstrated in its thorough Wildrobin evaluation. Gamblers frequently emphasise the site’s generous opening rewards, featuring complimentary spins and rebate benefits, turning it an desirable option for those trying to enhance their earnings. The casino also guarantees a smooth registration procedure, permitting users to commence gambling quickly without unnecessary complications.

    For those seeking Wild Robin Casino evaluations, general feedback focus on the site’s excellent user service and responsive design. The online site works under tight regulatory standards, ensuring that all transactions and playing adhere to honest practices. This trustworthiness is particularly vital for gamblers in the UK region, where reliability and safety are essential when selecting an digital gambling platform.

    Wildrobin digital gaming has also been celebrated for its varied entertainment collection, including trending games from well-established providers. Whether you prefer classical slot games like Golden Reel or immersive interactive dealer entertainment, the site provides something for everyone for anyone. Furthermore, the Wild Robin UK variant is tailored for mobile players, allowing players to enjoy their beloved entertainment on the run.

    When considering Wild Robin Casino feedback, it’s valuable to mention that conscious playing features are readily offered. Options such as spending restrictions and self-restriction choices help gamblers to maintain control over their playing behaviours. This emphasis on user well-being positions Wildrobin beyond many opponents in the sector.

    In summary, Wild Robin Casino rises as a credible and enjoyable virtual entertainment platform, especially for UK enthusiasts. With its blend of premium games, attractive rewards, and solid security measures, it continues to gain positive Wild Robin Casino evaluations from both casual and passionate gamblers. Whether you’re looking for enjoyment or potential profits, this online site provides a well-rounded journey worth investigating.

  3. После бурной ночи бывает так плохо. А дела не ждут. Капельница от алкоголя на дому — это когда врач приезжает сам. Сначала уходит интоксикация. Вывод из запоя капельница Екатеринбург — работает и ночью. Вся информация доступна здесь: капельница от похмелья купить [url=https://medpomosh.kapelnicza-ot-pokhmelya-ektb-xse.ru]https://medpomosh.kapelnicza-ot-pokhmelya-ektb-xse.ru[/url] И про срочный выезд по городу. Обращайтесь к специалистам.

  4. This post does a great job of presenting the topic in a clear but still meaningful way, because the organization, language, and overall tone make it easy to read while also encouraging a thoughtful and positive conversation in the comments section.

    Utforska porrarkivet

  5. wildrobin-elunk

    Wildrobin Casino, also known as the Wildrobin Casino, is a well-known digital casino site that has attracted significant interest among British gamblers for its extensive variety of betting choices and easy-to-navigate design [url=https://wildrobin-casino-9.vercel.app]wild robin casino reviews[/url] . Whether you’re looking for Wild Robin Casino feedback or just hoping for a dependable online casino experience, this site has everything for every player.

    As one of the top online casinos from Wild Robin, it shines for its strong focus to fairness, safety, and fun.

    One of the major attractions of Wild Robin Casino is its huge selection of betting options, covering both traditional slot machines and cutting-edge interactive dealer games. Players can relish games from leading game developers, promising exceptional images, buttery experience, and just rewards. Whether you’re a fan of progressive jackpots, competitive challenges, or live casino experiences, the site accommodates a broad spectrum of choices.

    For those looking insights on Wild Robin Casino, player feedback often point out the site’s responsive player service, generous rewards, and smooth phone-friendly design. The casino is crafted with British gamblers in focus, offering quick payouts, safe financial handling, and a inviting atmosphere. Many gamblers enjoy the transparent rules, which contribute to creating faith in the site.

    If you’re just starting to virtual casino play or exploring a fresh gaming platform, Wild Robin Casino is a reliable option. Its reputation as a legitimate virtual Wild Robin betting site continues to increase, thanks to its fair gaming environment and focus to gambler happiness. Whether you’re gambling for enjoyment or targeting for big wins, this site provides a reliable and fun session.

    For those investigating Wild Robin gambling insights, it’s important to mention that the site maintains a solid emphasis on protection, employing cutting-edge data protection to secure customer details. Additionally, the site’s licensing ensures compliance with British gaming rules, making it a trusted pick for British gamblers. With its mix of fun, fairness, and user-friendliness, Wild Robin Casino stays a front-runner in the digital betting world.

  6. Неотложка капельница от похмелья — это когда после бурной ночи. Ни встать, ни работать. Капельницы от похмелья — это когда врач приезжает сам. Сначала уходит интоксикация. Капельница от похмелья Екатеринбург — работает и ночью. Вся информация доступна здесь: капельница от похмелья анонимно [url=https://neotlozhka.kapelnicza-ot-pokhmelya-ektb-mwd.ru]капельница от похмелья анонимно[/url] И про капельницу на дому сколько стоит для Екатеринбурга. Иногда один звонок решает всё.

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

  8. Перед лечением врач уточняет, сколько длится запой, какой алкоголь употреблялся — крепкий, винный, пивной или другие напитки, — когда была последняя доза этанола и какие хронические заболевания имеются. Проводится осмотр, при необходимости назначаются анализ крови, исследования мочи, ЭКГ и дополнительные тесты. Лечение запоя в клинике или на дому может включать инфузию, растворы для коррекции водно-солевого баланса, витамины, глюкозу, седативные препараты, гепатопротекторы и другие медикаменты. Состав капельницы врач подбирает персонализированно, поэтому обещание одинакового «двойного» или «тройного» состава каждому больному не соответствует принципу индивидуальной терапии.
    Подробнее – [url=https://narkologicheskaya-klinika-v-ekb21.ru/]вывод наркологическая клиника в Екатеринбурге[/url]

댓글 달기

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