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

  1. Специалисты регулярно помогают при интоксикации, запоях, абстиненции и сложных состояниях зависимости.
    Узнать больше – [url=https://narkologicheskaya-klinika-v-ekb21.ru/]наркологическая клиника лечение алкоголизма Екатеринбург[/url]

  2. wildrobin-unise

    Wildrobin is an digital casino platform that has been drawing interest among British gamblers looking for a effortless and engaging playing journey [url=https://wildrobin-21.vercel.app]wildrobin casino[/url] . Known for its intuitive interface and diverse choice of entertainment, Wildrobin Casino offers something for all, from poker enthusiasts to fans of table games and real-time operator sessions. Whether you’re exploring for Wildrobin Casino opinions or simply exploring the top choices for online betting, this site stands out as a dependable option.

    One of the primary perks of Wildrobin is its ease of use. The platform is designed for both PC and handheld visitors, guaranteeing that gamblers can relish their preferred entertainment whenever, no matter where. With a priority on protection and equity, Wildrobin Casino the UK values gambler well-being, offering open wagering rules and responsible playing resources. This makes it a beloved selection for those seeking a trustworthy wild robin casino experience.

    For those fresh to virtual playing, Wildrobin provides a welcoming space with generous welcome rewards and promotions. Whether you’re hunting for free spins, deposit bonuses, or loyalty perks, the website guarantees that players get the best out of their playing games. Many wild robin casino reviews highlight the site’s dedication to gambler contentment, making it a well-liked choice among both new players and seasoned betters.

    If you’re searching for Wildrobin online or comparing wild robin casino opinions, it’s evident that this platform delivers a top-tier playing session. With a solid emphasis on equity, safety, and fun, Wildrobin Casino continues to attract players hunting for a honest and fun online casino website. Whether you’re into video slots, live dealers, or classic desk games, Wildrobin offers a well-rounded range to match each choice. For those looking a dependable Wildrobin Casino the UK experience, this website is definitely deserving checking.

  3. Лечение на дому строится индивидуально. Нарколог учитывает возраст пациента, стаж алкоголизма или наркомании, хронические заболевания, принимаемые препараты и результаты терапии, если она проводилась ранее. Врач может выполнить снятие острых проявлений, назначить детокс, провести медицинское лечение и объяснить дальнейшие варианты. В Воронеже вызов нарколога на дом дает возможность получить помощь быстро, анонимно и в привычной обстановке. При этом лечение зависимости не должно ограничиваться одной процедурой: пациенту могут потребоваться кодирование, лечение алкоголизма в клинике, психотерапия и реабилитация.
    Узнать больше – [url=https://narcolog-na-dom-voronezh017.ru/]вызов нарколога на дом в Воронеже[/url]

  4. Когда запой затягивается. Кто-то не хочет огласки. Нарколог на дом вывод из запоя — Осматривает, ставит систему. Потом давление выравнивают. Вывод из запоя на дому в Самаре — И в выходные. Вся информация доступна здесь: капельница от запоя на дому круглосуточно [url=https://stacionar.vyvod-iz-zapoya-na-domu-samara-dps.ru]https://stacionar.vyvod-iz-zapoya-na-domu-samara-dps.ru[/url] И про вызов нарколога на дом запой для региона. Обращайтесь к специалистам.

  5. wildrobin-Soopy

    Wildrobin-22’s online hub is an comprehensive online hub that focuses the Wildrobin Casino experience [url=https://wildrobin-22.onrender.com]wild robin[/url] . It offers players a comprehensive insight into one of the UK’s most sought-after online gambling destinations. Whether you’re a novice to online casinos or a seasoned gambler seeking updated perspectives, this platform serves as a useful tool for exploring Wildrobin Casino’s aspects, games, bonuses, and general credibility. With a rising curiosity in online gambling, especially in the UK, Wild Robin Casino has carved a niche position as a reliable brand among gamblers looking for a mix of excitement and fair playing.

    One of the main advantages of Wild Robin Casino is its emphasis on honesty and gambler feedback. The site motivates visitors to explore Wildrobin Casino testimonials, where actual gamblers post their stories, assisting others to make well-researched choices. Whether you’re curious about Wildrobin Casino’s regulation, transaction methods, or game selection, these testimonials deliver useful information that can guide your choice. The platform also highlights Wildrobin Casino’s standing for safe betting, ensuring that enthusiasts can appreciate their beloved activities while remaining within healthy limits.

    For those new with the phrase, Wild Robin Casino is a well-established digital betting site that serves United Kingdom enthusiasts with a wide range of slot games, table games, and real-time experiences. The hub’s user-friendly interface and attractive offers make it a popular choice, and Wild Robin Casino feedback areas assist gamblers to comprehend what to anticipate before registering. Whether you’re hunting for Wild Robin Casino reviews or simply seeking to investigate Wildrobin online, this resource serves as a useful guide to navigating the world of digital betting ethically.

    Moreover, Wild Robin Casino’s emphasis on safety and equity is a key advantage. Gamblers can trust on the fact that their deposits and private data are protected, thanks to strict government rules. The site also keeps gamblers on the most recent promotions, promising they never forget out on exclusive offers. From Wild Robin Casino reviews to thorough articles on how to maximise your profits, Wildrobin Casino’s resource hub offers a comprehensive overview of what distinguishes this gambling site shine in the dynamic online gaming arena. Whether you’re a lover of Wildrobin Casino or simply exploring Wild Robin Casino’s digital world for the first occasion, this hub promises you have all the details you need to relish a smooth playing experience.

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

  7. Лечение зависимости требует системного медицинского подхода. Одной процедуры или кратковременного улучшения самочувствия обычно недостаточно, если человек длительное время употребляет алкоголь или наркотические вещества. В клинике лечение алкоголизма и лечение наркомании строятся поэтапно: сначала врач проводит первичную диагностику, затем выполняется детоксикация, подбирается медикаментозная терапия, после стабилизации подключаются психолог, психотерапевт и реабилитационный персонал. Такой подход помогает не ограничиваться снятием физической симптоматики, а работать с причинами зависимости и привычке возвращаться к употреблению.
    Получить больше информации – [url=https://narkologicheskaya-klinika-balashiha.ru/]narkologicheskaya-klinika-pomoshch-na-domu[/url]

댓글 달기

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