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

  1. Помогаем быстро перейти от консультации к конкретному плану: выезд, стационар или наблюдение.
    Дополнительная информация – [url=https://6vyvod-iz-zapoya-podolsk77.ru/]http://6vyvod-iz-zapoya-podolsk77.ru[/url]

  2. Winaura is a up-and-coming name in the online gaming and wagering industry, offering a distinctive platform for fans looking for entertainment [url=https://win-aura-44.onrender.com]winaura live casino[/url] . Based on the website win-aura-44.onrender.comWinaura-44.onrender.com WinauraOnline.render.com, this environment appears to cater to players looking for a seamless and interactive journey. Whether you’re keen on gambling, online wagering, or other live games, Winaura aims to provide a contemporary and easy-to-use platform.

    As an digital betting environment, WinAura differentiates itself by delivering a diverse array of activities customised to various tastes. The platform probably includes timeless betting such as video slots, poker, and roulette, alongside real-time dealer sessions that deliver the thrill of a physical betting house to your monitor. For those who love sport wagering, Winaura may also provide up-to-date odds and a user-friendly system for laying wagers on their favourite sides and occasions.

    One of the major perks of Winaura is its convenience. As an online environment, it permits users from the Britain and further to enjoy their preferred activities whenever, anywhere, with just a few clicks. The platform appears to be structured with both novices and experienced betters in account, guaranteeing a smooth and enjoyable journey for everyone. Whether you’re discovering WinAura digitally for the first time or returning for another session, the environment seems to emphasise simplicity and enjoyment quotient.

    For those seeking to check the legitimacy of Winaura, it’s important to examine for verified certifications and player reviews. As winaura casino online goes on develop, honesty and trust stay important considerations for users. While the site still hasn’t be well-known, its existence on services like render.com suggests it is continuously maintained.

    If you’re hunting for a trustworthy winaura official experience, it’s deserving discovering the platform’s offerings to see if it aligns with your gaming preferences. With a concentration on live casino experiences and betting opportunities, Winaura could be a promising option for those looking for a new and dynamic online gaming setting. Always make sure you bet wisely and according to your budget, as the thrill of WinAura’s wagering must not occur at the price of monetary balance. Whether you’re drawn to the allure of winaura casino or merely searching for a alternative approach to relish digital fun, this environment delivers a compelling alternative valuable considering.

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

  4. WinAura is a emerging name in the digital gaming world [url=https://winaura-44.pages.dev]winaura casino online[/url] . It provides players with an engaging online gaming experience. Whether you’re a long-time player or new to digital gaming, WinAura offers a platform designed to meet wide-ranging needs. Renowned for its easy-to-navigate design and a broad range of games, WinAura shines as a trustworthy option for those seeking amusement and potential winnings.

    WinAura casino has rapidly earned attention for its smooth integration of both traditional and contemporary gaming options. From classic slot machines and desk entertainment to live dealer experiences, the platform ensures diversity for all gambler. The site’s emphasis on accessibility makes it simple for players to navigate, whether they’re entertaining on desktop or smartphone tools. This simplicity is a major factor in its increasing popularity among local gamblers.

    For those keen in live casino experiences, WinAura provides authentic playing with professional hosts, bringing an real touch to the digital gaming environment. The win aura gaming website also incorporates wagering alternatives, allowing users to join in sports betting alongside their casino activities. This two-fold solution makes it a flexible pick for those searching to diversify their betting passions.

    One of the standout aspects of WinAura is its dedication to providing a protected and fair gaming environment. As a winaura official platform, it prioritises transparency, ensuring gamblers can believe in the fairness of its entertainment. The site’s standing is established on dependability, making it a trusted place for those seeking a genuine online gaming experience.

    Whether you’re exploring winaura wagering opportunities or simply hoping to appreciate some entertainment, WinAura offers a well-rounded adventure. Its mix of convenience, diversity, and security makes it a powerful contender in the fast-paced online entertainment sector. For gamblers in the United Kingdom and further, WinAura stands for a encouraging choice for both occasional and serious gamblers alike.

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

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

댓글 달기

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