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”의 92,121개의 댓글

  1. Этот обзор сосредоточен на различных подходах к избавлению от зависимости. Мы изучим традиционные и альтернативные методы, а также их сочетание для достижения максимальной эффективности. Читатели смогут открыть для себя новые стратегии и подходы, которые помогут в их борьбе с зависимостями.
    Откройте для себя больше – [url=https://tga-info.ru/kakie-effekty-okazyvaet-vyvod-iz-zapoya/]вывод из запоя круглосуточно в Рязани[/url]

  2. Vicibet is one of the top-rated digital betting platforms in the Great Britain, delivering a wide range of betting experiences for players seeking thrills and convenience [url=https://vicibet-casino-1.vercel.app]vici bet[/url] . Whether you’re looking for vicibet online, casino Vicibet, or Vicibet betting, this platform offers a seamless way to enjoy your favourite games from the ease of your residence. With a strong reputation as the vicibet official site, it dominates as a preferred destination for both beginner and experienced gamblers.

    The online Vicibet casino experience is engineered to be intuitive, including a modern dashboard that makes navigation simple. From timeless slot titles to live dealer games, players can explore a wide-ranging selection of gambling options. Whether you prefer the excitement of Vicibet live casino or the simplicity of slot games, the platform guarantees smooth gameplay with minimal delay. The site also serves sports betting, providing competitive odds and live news on big events.

    One of the key advantages of Vicibet is its convenience. As a Vicibet online casino, it supports different transaction choices, including bank transfers, digital wallets, and digital currencies, making deposits and withdrawals quick and safe. The platform is also responsive on mobile, enabling users to enjoy online Vicibet on their mobile phones or portable tablets without compromising performance.

    For those new with the platform, it’s definitely worth highlighting that vicibet is often mistaken with similar platforms like Vici Bet or vici bet casino, but the vicibet official site continues to be a exceptional selection due to its trustworthiness and vast selection of games. Whether you’re looking for Vicibet betting options or simply want to discover the newest online gaming developments, this platform delivers a well-rounded experience.

    In summary, if you’re searching for the top vicibet casino online, this site delivers a flawless mix of entertainment, safety, and simplicity. With its increasing reputation in the Great Britain, it remains to be a leading selection for those seeking an enjoyable and profitable gambling experience.

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

  4. В этой публикации мы рассматриваем важную тему борьбы с зависимостями, включая алкогольную и наркотическую зависимости. Мы обсудим методы лечения, реабилитации и поддержку, которые могут помочь людям, столкнувшимся с этой проблемой. Читатели узнают о перспективах выздоровления и важности комплексного подхода.
    Продолжить изучение – [url=https://gorlonosik.ru/voprosy-otvety/vyvod-iz-zapoya-na-domu-effektivnye-metody-i-rekomendatsii.html]детоксикация на дому[/url]

  5. Текст посвящён распространённым мифам о зависимости и их развенчанию. Мы предоставим научно обоснованную информацию и дадим рекомендации по выбору эффективного способа борьбы с зависимым поведением.
    Ознакомьтесь поближе – [url=https://nogtipro.com/questions/kak-vyjti-iz-alkogolnogo-zapoya-sovety-i-rekomendatsii/]вывести из запоя в наркологической клинике[/url]

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

  7. В этой статье обсуждаются актуальные медицинские вопросы, которые волнуют общество. Мы обращаем внимание на проблемы, касающиеся здравоохранения и лечения, а также на новшества в области медицины. Читатели будут осведомлены о последних событиях и смогут следить за тенденциями в медицине.
    Открыть полностью – [url=https://novorossportal.ru/news/effektivnoe-vyvedenie-iz-zapoya/]вывод из алкогольного запоя[/url]

  8. Врач наркологической клиники — это не просто работа. Кого-то привозят родные. Наркологическая клиника — Круглосуточно. Сначала снимают интоксикацию. Наркологическая клиника лечение алкоголизма — И круглосуточно. Советую глянуть источник: наркологическая больница нижний новгород [url=https://vrach.narkologicheskaya-klinika-nnovgorod-vmj.ru]наркологическая больница нижний новгород[/url] И про частные клиники по городу. Обращайтесь к специалистам.

  9. ViciBet has become a leading most sought-after online gaming sites in recent years, delivering a vast selection of entertainment options, competitive odds, and a smooth interface [url=https://vicibet-casino.vercel.app]vicibet official vicibet[/url] . Whether you’re looking for Vicibet’s casino, ViciBet online, or ViciBet betting, this platform offers a secure zone for new and experienced gamblers. As a leading vicibet official sites, it dominates for its consistency, wide-ranging selection of games, and intuitive design.

    The ViciBet online casino experience is crafted to appeal to a worldwide community, guaranteeing convenience. With a firm focus on safety and honest gaming, users can trust that their transactions and confidential details are protected. The platform supports several payment methods, making deposits and withdrawals simple and uncomplicated. Whether you’re playing slot games, roulette and blackjack, or real-time casino games, vicibet live casino delivers premium broadcasts and instant communication with professional hosts.

    For first-time virtual wagering, vicibet online creates a friendly space with clear tutorials and a responsive assistance squad. The site is optimised for both desktop and mobile devices, ensuring users to play their preferred entertainment whenever they like, on the go. With regular offers and excellent rewards, vicibet betting keeps a leading option for those looking to maximise their entertainment value.

    While Vicibet’s casino isn’t the same level of fame as long-standing platforms, its rapid growth and favourable feedback highlight its ability as a serious contender in the industry. If you’re hunting down a trustworthy vicibet casino online adventure, this platform is absolutely worth exploring. Whether you’re looking for Vicibet, ViciBet casino, or related platforms, Vicibet Gaming delivers a polished and interactive platform that keeps users returning for better experiences. Always ensure you play within limits and adhere to your financial limits.

댓글 달기

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