KobeSpiral2021

SpringBoot

SpringBootの概要

Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".(公式引用)

SpringBootのメリット

SpringBootのデメリット

学習する順番のススメ

  1. 全体像.各レイヤの役割を知ろう.
  2. レイヤ間でやり取りするデータ (Entity, Form, DTO)を理解しよう.
  3. データの永続化について.DB設定,@Repository を理解しよう.
  4. 入力データのチェック(バリデーション)は,コントローラ層でやろう
  5. テンプレートエンジン Thymeleaf を使って,画面を作ろう
  6. 例外の投げ方,受け方を知ろう
  7. (発展)テストしてみよう.
  8. (発展)設定を外部から入れてみよう

サブページ

トラブルシューティング

何かおかしかったら...

全部入りのdependencies

Spring Initializrで当面必要そうなものを全部入れた場合の dependenciesセクションの内容を書いておく.

何かおかしかったら,自分のbuild.gradleにこれをコピペするとよかろう.

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
	//セキュリティ入れる場合は↓を外す
	// implementation 'org.springframework.boot:spring-boot-starter-security'
	implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
	implementation 'org.springframework.boot:spring-boot-starter-validation'
	implementation 'org.springframework.boot:spring-boot-starter-web'
	compileOnly 'org.projectlombok:lombok'
	developmentOnly 'org.springframework.boot:spring-boot-devtools'
	runtimeOnly 'mysql:mysql-connector-java'
	annotationProcessor 'org.projectlombok:lombok'
	testImplementation('org.springframework.boot:spring-boot-starter-test') {
		exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
	}
	//testImplementation 'org.springframework.security:spring-security-test'
}

入っているもの


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-11-23 (木) 23:14:42