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”의 79,970개의 댓글

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

  2. spinogambino-inhego

    Hrani na mobilu prochazi v posledni době obrovsky rozmach a spinogambino casino app je přesně tim řesenim, ktere hledaji vsichni milovnici kvalitni zabavy na cestach [url=https://spinogambino-casino.cz/app]spinogambino app[/url] . Pokud touzite mit sve oblibene sloty a kasinove hry vzdy po ruce, nainstalovani teto aplikace je tou nejlepsi moznosti. Aplikace poskytuje intuitivni prostředi, bleskove načitani her a plnou podporu veskerych bonusů, na ktere jste navykli z desktopove verze.

    Proces, jak ziskat přistup k teto platformě, je velmi jednoduchy. Pokud vas zajima spinogambino app download, je potřeba navstivit oficialni stranky, kde naleznete přimy odkaz. Majitele zařizeni s operačnim systemem Android mohou pouzit spinogambino apk download, ktery je navrzen tak, aby byl zcela bezpečny a optimalizovany pro hladky běh. Samotny spinogambino apk soubor stahnete během par sekund a cely proces instalace je velmi rychla zalezitost.

    Mnoho hračů vyhledava spino gambino app, protoze si touzi po svobodu hrani bez omezeni. S touto mobilni aplikaci ziskate přistup ke svemu hernimu učtu, moznost provadět vklady a vyběry a vyuzivat exkluzivni mobilni akce. Hledani vyrazů jako spino gambino download nebo spino gambino casino app potvrzuje, ze komunita hračů se stale vice přesouva k mobilnim zařizenim. Diky tomu, ze je spino gambino apk často vylepsovan, mate vzdy jistotu nejmodernějsiho zabezpečeni a přistupu k novym hram v nabidce her.

    Pokud preferujete rychlemu a snadnemu přistupu, spinogambino download je nejlepsi cestou, jak začit. Aplikace odstraňuje nutnost stale spoustět internetovy prohlizeč a garantuje stabilni spojeni i při slabsim internetu. S aplikaci spinogambino apk tak ziskate kompletni kasino přimo ve vasi kapse. Nečekejte na nic a otestujte spinogambino casino app jestě dnes, abyste zjistili, jak pohodlne můze byt hrani vasich oblibenych her kdekoli a kdykoli. Je to nejlepsi způsob, jak vylepsit svůj herni zazitek na novou uroveň diky modernim technologiim, ktere jsou nyni dostupne vsem uzivatelům.

  3. В этой публикации мы исследуем ключевые аспекты здоровья, включая влияние образа жизни на благополучие. Читатели узнают о важности правильного питания, физической активности и психического здоровья. Мы предоставим практические советы и рекомендации для поддержания здоровья и развития профилактических подходов.
    Где можно узнать подробнее? – [url=https://shkatulkaesoteric.ru/skolko-stoit-kapelnica-ot-zapoya/]прокапаться после запоя[/url]

  4. Эта доказательная статья представляет собой глубокое погружение в успехи и вызовы лечения зависимостей. Мы обращаемся к научным исследованиям и опыту специалистов, чтобы предоставить читателям надежные данные об эффективности различных методик. Изучите, что работает лучше всего, и получите информацию от экспертов.
    Дополнительно читайте здесь – [url=https://tokzamer.ru/zdorove/narkolog-dom]вызвать нарколога на дом круглосуточно[/url]

  5. needforslotsbonusreview-chort

    Within NeedForSlots, we firmly believe that openness and skill form the basis of a great betting encounter [url=https://needforslotsbonusreview.net/about-team]need for slots[/url] . When you access our site, you really aren’t only touching down on some other index of gambling sites; you are navigating a network built by enthusiastic players who exist and breathe the domain of internet gambling. Our background page acts as a gateway towards the perspectives of our dedicated professionals, supplying perspective concerning who we are and why we do what we do.

    The NeedForSlots team is comprised of seasoned business authorities, statistics analysts, and professional evaluators who maintain a collective objective: to offer the highest quality data in the sector. We understand that the digital casino environment is often confusing, filled with many options, tricky promotions, and varying amounts of security. That is why our team rigorously examines each individual platform before it even is featured on our domain. We peer beyond the glossy visuals to analyze the genuine utility of new player deals, the integrity of playthrough rules, and the quickness of financial transactions.

    We pride ourselves on an objective approach that sets the player top. Our NeedForSlots including high-quality play is equaled just by our commitment to ethical gambling. Each associate of our group offers a special set of competencies to the discussion, guaranteeing that our reports remain not merely precisely correct but also user-friendly and easy to digest. Whether you remain a recreational bettor scouting for some free-time amusement or a big spender searching for the top VIP perks, we aspire to serve as your most trusted partner in the virtual gambling realm.

    By learning about the individuals supporting NeedForSlots, you could be certain that you are acquiring advice from authentic humans with a genuine love for the game. We invite you to explore our origins and find the rigorous norms we keep our staff to. By joining us, your gaming quest is supported by a crew that deeply values about your happiness and security.

  6. Обзор посвящён процессу восстановления после зависимостей. Мы расскажем о различных этапах реабилитации, поддерживающих ресурсах и важности мотивации в достижении устойчивого выздоровления.
    Узнать больше – [url=https://watertechology.ru/pages/vyvedenie-iz-zapoya-v-bolnice/]стационар вывод из запоя[/url]

  7. Эта статья освещает различные аспекты освобождения от зависимости и пути к выздоровлению. Мы обсуждаем важность осознания своей проблемы и обращения за помощью. Читатели получат практические советы о том, как преодолевать трудности и строить новую жизнь без зависимости.
    Читать полностью – [url=https://samzan.ru/psihiatr-narkolog-na-dom/]наркология на дом[/url]

  8. В этой медицинской статье мы погрузимся в актуальные вопросы здравоохранения и лечения заболеваний. Читатели узнают о современных подходах, методах диагностики и новых открытий в научных исследованиях. Наша цель — донести важную информацию и повысить уровень осведомленности о здоровье.
    Разобраться лучше – [url=https://renobuilder.ru/pages/vyvod-iz-zapoya-v-moskve-v-stacionare/]лечение запоя в стационаре москва[/url]

  9. Эти направления охватывают как экстренное выведение из запоя и лечение похмелья, так и более продолжительную борьбу с алкоголизмом. Конкретный метод выбирается не по названию услуги, а после оценки самочувствия, противопоказаний и медицинских показаний.
    Ознакомиться с деталями – [url=https://vyvod-iz-zapoya-v-ekaterinburge24.ru/]вывод из запоя на дому цена в Екатеринбурге[/url]

  10. needforslotsbonusreview-Arbinty

    Regarding gamers who relish the thrill of betting on the go, the needforslots app offers a comprehensive system built to deliver a premium betting session straight to your handset [url=https://needforslotsbonusreview.net/app]needforslots app[/url] . Assuming you are a fan of vintage one-armed bandits or modern online reels, this application functions as a flawless portal to top-tier mobile slots and engaging functions. By focusing on a intuitive interface, the site certifies that navigating via your preferred rounds is effortless, irrespective of your digital skill.

    The needforslots app is developed to handle a broad selection of devices, acting as a dependable mobile suite for Android players as well as supplying a fluid experience as a top-tier casino app for Apple. This cross-platform functionality signifies that your move to an online casino mobile space is totally hassle-free. As soon as you log in, you are met by an large library of games that perform smoothly on smaller monitors, guaranteeing that visuals and audio stay sharp and engaging.

    One of the standout attributes of the platform is its dedication to incentivizing players from the instant they sign up. Fresh sign-ups can leverage a lucrative signup incentive, which regularly includes a bundle of free spins to aid start your journey initiated. These promotions provide a fantastic way to check out the huge array of mobile slots without directly gambling your personal money. Moreover, for people who desire the genuineness of a authentic gaming floor, the portable live section carries expert hosts and live play directly to the grasp of your hand.

    Safety and comfort are at the heart of the service offered at needforslotsbonusreview.net/app. By selecting this mobile solution, you gain access to a secure play zone during which deposits and payouts are handled quickly. Whether you are riding, chilling at the house, or on a break, the capacity to gamble everywhere at any moment renders this app a must-have for any devotee. Experience the evolution of online gaming today by viewing each feature this portable-centric platform has to give to its growing community of members.

댓글 달기

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