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”의 18,194개의 댓글

  1. В данной статье мы акцентируем внимание на важности поддержки в процессе выздоровления. Мы обсудим, как друзья, семья и профессионалы могут помочь тем, кто сталкивается с зависимостями. Читатели получат практические советы, как поддерживать близких на пути к новой жизни.
    Лови подробности – [url=https://narcolog-life.com/article/alkogol-i-psihotropnye-preparaty-smertelno-opasnaya-kombinacziya/]наркология наркологический центр[/url]

  2. Siempre que eres un fanatico de los pasatiempos de apuestas y persigues una interfaz novedosa, es probable que tengas conocido sobre need for slots [url=https://need-for-slots-42.vercel.app]need for slots[/url] . Este portal se ha posicionado agilmente como una opcion relevante para aquellos que gozan de la emocion de las maquinas tragamonedas partiendo de la confort de su casa. Al entrar a needforslots, los participantes descubren un entorno digital perfeccionado, disenado especificamente para proporcionar una travesia de usuario dinamica y dinamica. La gente que pretenden el ideal need for slots online localizaran un catalogo diverso que se adapta a todo clase de preferencias, partiendo desde los clasicos juegos de frutas asi como las video slots con argumentos modernas y visuales de gran precision.

    Al ejecutar una needforslots resena minuciosa, es evidente que la entidad sobresale por su agilidad de navegacion y su compromiso con el divertimento responsable. Numerosos apostadores en Espana ya han anadido needforslots espana en su rutina de entretenimiento digital, apreciando especialmente la velocidad en la carga de los juegos y la conexion movil que presenta need for slots. El casino need for slots no exclusivamente se enfoca en la numero de opciones, sino en la excelencia de su software, asegurando rondas de juego justas y protegidas para el conjunto de su comunidad.

    En caso de que te cuestionas por que seleccionar el operador needforslots ante otras propuestas, la solucion se encuentra en su diseno intuitiva y en la continua renovacion de su catalogo. Ya sea que prefieres un need for slot con premio acumulado como si deseas una forma mas simple, en needforslot encontraras opciones para cada tipo de usuario. La popularidad de need for slots espana continua creciendo debido al boca a boca de una base contenta. No cabe duda de que needforslots online se ha consolidado como un ejemplo fundamental en el mercado. Si estas intentando adentrarte en el universo de las apuestas online, el portal needforslots representa una acceso de ingreso segura y emocionante. Explora hoy mismo lo que needforslots cuenta para brindar y conoce por que se ha transformado la alternativa predilecta de numerosos participantes que disfrutan del need for slots online.

  3. spingrannycasinobonus-Carymn

    Should you are hunting for an exciting way to enjoy your preferred slots and casino games while traveling, the spingranny app provides a seamless mobile gaming adventure [url=http://spingrannycasinobonus.net/app]spingranny apk[/url] . Crafted for players who demand convenience and sharp graphics, this platform brings the rush of the casino immediately to your handheld. Regardless of whether you are a relaxed player or a experienced veteran, the spin granny app presents a simple interface that makes navigating through diverse titles intuitive and quick.

    Getting started is straightforward for Android members. To access the entire suite of games, you need to perform the spingranny download directly from the official portal. After you have grabbed the spingranny apk file, the setup procedure is uncomplicated, permitting you to access premium gaming tools in just a few minutes. Many players favor the spin granny apk because it is refined for speed, verifying that action stays steady even during intense gaming sessions.

    If you utilize the spingranny casino app, you attain access to a broad selection of bonuses and exclusive offers customized specifically for handheld users. The portability of the spin granny download implies you rarely need to lose daily rewards or unique tournaments. The programmers have focused on creating a safe environment so as to ensure every spin granny casino app user can have tranquility while making bets or collecting winnings.

    Prior to you begin, ensure your device settings enable for downloads from unknown sources to facilitate the spingranny download process. By choosing the specialized spingranny casino app, you are picking a better mobile option that blends fun with reliability. Join many of other players currently by completing your spin granny download and uncovering why this app is evolving into a prime option for mobile gaming enthusiasts globally. With frequent updates and a growing library of games, the spin granny app is always evolving to provide the greatest potential experience for every player who chooses to hold the casino in their hand.

  4. I katanoisi ton oron kai proypotheseon apotelei to vathro mias prostatevmenis kai ypevthynis ebeirias paichnidiou sto diadiktyo [url=https://spinmama.org.gr/terms-and-conditions]Spinmama[/url] . Ean eiste christis tis platformas Spinmama, einai exairetika simadiko na afierosete chrono gia na meletisete diexodika tin enotita me tous kanones leitourgias pou parechei o istotopos. To Spin Mama thetei to protokollo pou prostatevei toso tous paiktes oso kai to idio to kazino, proagodas ti diafaneia se kathe synallagi.

    Oi oroi chrisis pou tha vreite sto Spinmama kalyptoun ena evry fasma thematon pou schetizodai me ti symmetochi sas. Apo ti dimiourgia kai ti diacheirisi tou logariasmou sas, mechri tis diadikasies katatheseon, analipseon kai ti chrisi ton prosforon, kathe simeio einai ftiagmeno gia na diafylassei ton christi. Diavazodas prosektika to keimeno, boreite na prolavete parexigiseis schetika me tis apaitiseis stoichimatismou i tous chronikous periorismous pou endechetai na synodevoun tis prosfores tou Spin Mama.

    Epipleon, i selida me tous orous kai tis proypotheseis parechei plirofories schetika me to ypevthyno paichnidi kai ta metra avtoapokleismou. Einai i desmevsi tou Spinmama pros to koino tou gia tin parochi enos asfalous chorou diaskedasis. Thymitheite oti i katanoisi ton kanonon einai avti pou kanei tin ebeiria sas pio aneti kai choris aproopta. Eite prokeitai gia themata dikaiou, eite gia ton tropo pistopoiisis ton prosopikon sas stoicheion, i selida avti apotelei to vasiko odigo tou paikti.

    Sas protrepoume na elegchete sychna tin en logo selida, kathos oi rythmiseis tou Spin Mama endechetai na allazoun oste na symvadizoun me tis trechouses rythmistikes apaitiseis kai tis anages ton christon. I enimerosi einai to kleidi gia mia epitychimeni kai aproskopti paramoni ston kosmo tou diadiktyakou paichnidiou. Me tin epilogi tou Spinmama, epilegete enan synergati pou thetei ti diafaneia sto proskinio tis schesis tou me ton paikti, parechodas ola ta aparaitita ergaleia gia mia timia kai evcharisti ebeiria.

댓글 달기

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