0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Spring Bootでのweb app開発 #1

Last updated at Posted at 2024-12-14

はじめに

みなさま初めまして。Nyamaです。
Qittaを含め、こういった技術ブログは初めて書くため、不慣れな点はご承知おきください。

Spring Bootを用いたWebアプリを製作するので、自分のためにも制作過程をまとめていきます。

制作するアプリの概要

  • 飲食店で利用されている注文システム
  • 客が席に置かれているQRコードを読み取ることで利用開始する

開発環境

製品名 version
IDEA JetBrains社 Intellij IDEA Community Edition 2024.3.1
buildツール gradle Groovy 3.0.22
Framework Spring Boot 3.4.0
データベース Mysql 8.0.40

Spring Frameworkについて(2024/12/14 追記)

  • Spring BootはSpring Framework上で構築されているJavaベースのフレームワーク
  • Webサーバが既に組み込まれているため、開発者が別途サーバをインストールする必要がない
  • Spring Initializrを使用することで、利用するspring-boot-starterを簡単に組み込める

プロジェクトの立ち上げ方

  • Intellij IDEAから新しいプロジェクトを立ち上げる際に左手側のGenerators->start.spring.ioを選択することでSpring Initializrを利用できる
  • 追加したstarterは"Spring Boot DevTools", "Spring Web", "Thymeleaf"
  • その後"Lombok" や"Spring Data JPA"を追加しているが、おいおいできるので、最初は上記の物だけで良い気がする

アプリ稼働中に変更を反映させる方法

  • File => Settings => Build, Execution, Deployment => Compilerへ移動後、"Build project automatically"にチェックを入れApplyする



  • src/main/resources/application.propertiesに以下のコードを追記する
 spring.thymeleaf.prefix=file:./src/main/resources/templates/
 spring.thymeleaf.cache=false
  • 調べてみると Helo => Find Acction から "Registry"を開き "compiler..."にチェックを入れるとの記事もあったが、versionの違いか、自分の環境ではその項目がなかったが、問題なくできた
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?