近年來,Spring Boot 成為了 Java 開發領域中一個不可或缺的框架。它提供了一種簡化的方式來構建和部署生產級的應用程式,讓開發人員能夠更快速地將想法轉化為可運行的產品。Spring Boot 的自動配置功能和嵌入式伺服器使得應用的開發和測試變得更加高效,並減少了繁瑣的配置過程,從而專注於業務邏輯。
課程將從環境設置開始,指導學員如何搭建 Spring Boot 開發環境,然後探討依賴注入、MVC 模式、RESTful 服務等關鍵主題。學員將學會如何使用 Thymeleaf 進行前端模板渲染,並了解如何與數據庫進行數據交互。安全性和錯誤處理也是課程的重要組成部分,這將幫助學員在實際開發中應對各種挑戰。
本課程不僅會提供理論知識,還會透過實作案例幫助學員在實際操作中鞏固所學。通過學習,學員將能夠開發和部署 Spring Boot 應用,並掌握相關技術在商業上的應用。
無論你是希望提升自身技能,還是希望進一步了解如何在實際工作中運用 Spring Boot,本課程都能為你提供所需的知識和工具,助你在 Java 開發領域中更上一層樓!
課程名稱: |
Java Spring Boot 應用課程 - 簡稱:Java Spring Boot Training Course |
課程時數: | 18 小時 (共 6 堂) |
適合人士: | 具備基本 Java 知識。 |
授課語言: | 以廣東話為主,輔以英語。 |
課程筆記: | 本中心導師親自編寫中文為主筆記,而部份中文字附有英文對照。 |
課程名稱:Java Spring Boot 應用課程 - 簡稱:Java Spring Boot Training Course |
1 入門及開始
1.1 Java Spring Boot 介紹
1.2 安裝
1.2.1 Java JDK 和 OpenJDK
1.2.1.1 Java JDK
1.2.1.2 OpenJDK
1.2.1.3 Java JDK vs OpenJDK
1.2.1.4 安裝JDK
1.2.2 Maven
1.2.2.1 Maven 介紹
1.2.2.2 安裝 Maven
1.2.3 Git
1.2.3.1 Git 介紹
1.2.3.2 安裝 Git
1.2.4 Eclipse
1.2.4.1 Eclipse介紹
1.2.4.2 安裝 Eclipse
1.2.4.3 Eclipse Installed JRE
1.2.4.4 Eclipse Maven Installations
1.2.4.5 Eclipse Maven Global Settings 和 User Settings
1.3 建立第一個 Spring Boot Application (Project properties, pom.xml, dependency management, build and run)
1.3.1 Maven Project
1.3.2 pom.xml
1.3.3 Packages and classes
1.3.4 引進 Spring Boot / Annotations
1.3.4.1 Annotations
1.3.4.2 @SpringBootApplication
1.3.4.3 @RestController
1.3.4.4 @RequestMapping
1.3.4.5 更多的 @RequestMapping 概念
1.3.4.6 main Method
1.3.5 Maven Build
1.3.6 Executable JAR / Spring Boot Executable JAR
1.3.6.1 Executable JAR
1.3.6.2 Spring Boot Executable JAR
2 基本的 RESTful 服務
2.1 RESTful 服務介紹
2.2 示範: Restful API
3 application.properties
3.1 application.properties 介紹
3.2 示範: application.properties
3.3 Custom Configurations
3.4 示範: application.properties 內使用 Custom Configurations
4 Servlet
4.1 Servlet 介紹
4.2 示範: 基本 Servlet in Spring Boot
4.3 Servlet Listener 介紹
4.4 示範: 基本 Servlet Listener in Spring Boot
4.5 Servlet Filter 介紹
4.6 示範: 基本 Servlet Filter in Spring Boot
4.7 Servlet WAR(Web ARchive)
4.8 示範: 基本 Servlet WAR
5 Spring Boot Bean
5.1 Spring Boot Bean 介紹
5.2 示範: 基本 Bean
5.3 示範: 豐富 Bean 的內容
5.4 示範: Primary Bean
5.5 示範: Bean Scopes, Singleton Bean and Prototype Bean
5.6 Spring AOP (Aspect Oriented Programming)
5.6.1 Spring AOP (Aspect Oriented Programming) 介紹
5.6.2 示範: Spring AOP (Aspect Oriented Programming)
5.7 @Qualifier / Custom Annotations
5.7.1 @Qualifier 介紹
5.7.2 示範: @Qualifier
5.7.3 示範: 自訂 @Qualifier / Custom Annotations
6 Spring MVC (Model-View-Controller)
6.1 Spring MVC (Model-View-Controller) 介紹
6.2 @Controller and @RestController
6.2.1 @Controller
6.2.2 @RestController
6.2.3 示範: @Controller and @RestController
6.3 @PathVariable
6.3.1 @PathVariable 介紹
6.4 示範: @PathVariable
6.5 @MatrixVariable
6.5.1 @MatrixVariable 介紹
6.6 示範: @MatrixVariable
6.7 @RequestParam
6.7.1 @RequestParam 介紹
6.7.2 示範: @RequestParam (第 1 部份: 單一欄位)
6.7.3 示範: @RequestParam (第 2 部份: 多個欄位)
6.7.4 示範: @RequestParam (第 3 部份: 上傳檔案)
7 Thymeleaf
7.1 Html Template Mode
7.1.1 Html Template Mode 介紹
7.1.2 示範: Html Template Mode
7.2 Xml Template Mode
7.2.1 Xml Template Mode 介紹
7.2.2 示範: Xml Template Mode
7.3 External HTML Template Resources
7.3.1 External HTML Template Resources 介紹
7.3.2 示範: External HTML Template Resources
7.4 變數與渲染 (Render) 概念
7.4.1 變數與渲染 (Render) 介紹
7.4.2 Thymeleaf 表達式語言(Expression Language, EL)介紹
7.4.3 示範: 設定單一數據
7.4.4 示範: 設定一系列數據
7.5 Prefix 和 Suffix
7.5.1 Prefix (前綴) 介紹
7.5.2 Suffix (後綴) 介紹
7.5.3 示範: Prefix 和 Suffix
8 Spring Boot + Thymeleaf
8.1 Spring Boot + Thymeleaf 介紹
8.2 org.springframework.ui.Model
8.3 示範: Spring Boot + Thymeleaf
8.4 靜態資源(Static Resources)
8.4.1 靜態資源(Static Resources)介紹
8.4.2 示範: 靜態資源(Static Resources)
8.5 Externalizing Text(外部化文本)
8.5.1 Externalizing Text(外部化文本)介紹
8.5.2 示範: Externalizing Text(外部化文本)(純文字)
8.5.3 示範: Externalizing Text(外部化文本)(HTML)
8.5.4 示範: Externalizing Text(外部化文本)(i18n, internationalization, 國際化)
8.6 Thymeleaf Numbering
8.6.1 示範: Thymeleaf Numbering
8.7 Thymeleaf String
8.7.1 示範: Thymeleaf String
8.8 Thymeleaf Date Time
8.8.1 示範: Thymeleaf Date Time
8.9 Thymeleaf 文字常量(Literals 及條件判斷(Conditional Statements)
8.9.1 示範: Thymeleaf 文字常量(Literals 及條件判斷(Conditional Statements)
8.10 Thymeleaf Operators
8.10.1 示範: Thymeleaf Operators
8.11 Thymeleaf Conversion
8.11.1 Thymeleaf Conversion 介紹
8.11.2 IStandardConversionService 介紹
8.11.3 示範: Thymeleaf Conversion + IStandardConversionService + Dialect
8.11.4 示範: Spring Boot + Thymeleaf Conversion
8.12 Spring Boot + Thymeleaf: 為表單注入數據
8.12.1 示範: Spring Boot + Thymeleaf: 為表單注入數據
8.13 Lazy Loading (懶加載)
8.13.1 示範: Thymeleaf Lazy Loading (懶加載)
8.13.2 示範: Spring Boot + Thymeleaf Lazy Loading (懶加載)
8.14 Thymeleaf Fragments
8.14.1 Thymeleaf Fragments 介紹
8.14.2 示範: Fragments (基本)
8.14.3 示範: Fragments (多組數據)
8.14.4 示範: Fragments (Selectors)
8.14.5 示範: Fragments (參數使用)
8.14.6 示範: Fragments (insert, replace, include)
8.14.7 示範: Fragments (多個靜態參數)
8.14.8 示範: Fragments (多個動態參數)
8.15 th:block
8.15.1 th:block 介紹
8.15.2 示範: th:block
8.16 註解 / 注釋
8.16.1 示範: 註解 / 注釋
8.17 Thymeleaf Inlining (內聯)
8.17.1 Thymeleaf Inlining (內聯) 介紹
8.17.2 示範: Thymeleaf Inlining (內聯)
8.18 Custom Tags 及 Attributes
8.18.1 示範: Custom Tags + Dialect
8.18.2 示範: Custom Attributes + Dialect
8.19 Thymeleaf Configurations / Template Resolvers
8.19.1 示範: Thymeleaf Configurations / Template Resolvers
8.20 View Resolver
8.20.1 View Resolver 介紹
8.20.2 示範: View Resolver
9 Spring Data
9.1 Spring Data 介紹
9.2 MySQL
9.2.1 MySQL 介紹
9.2.2 安裝 MySQL
9.2.2.1 安裝 Microsoft .NET Framework Developer Pack
9.2.2.2 安裝 Microsoft Visual C++ Redistributable (x64)
9.2.2.3 安裝 MySQL
9.2.2.4 設定 MySQL
9.3 示範: Spring Boot + Spring Data
9.4 示範: Spring Boot + Spring Data (進階手法 1)
9.5 示範: Spring Boot + Spring Data (進階手法 2)
10 Error Handling
10.1 Spring Boot Error Handling 機制
10.2 示範: Error Handling (靜態錯誤頁面)
10.3 示範: Error Handling (@ControllerAdvice)
11 Spring Cache
11.1 Spring Cache介紹
11.2 示範: Spring Cache
12 Spring Security
12.1 Spring Security 介紹
12.2 示範: Spring Boot + Spring Security (generated security password)
12.3 示範: Spring Boot + Spring Security (username + password in application.properties)
12.4 示範: Spring Boot + Spring Security (多個 username + password in @Bean 及 logout)
12.5 示範: 控制驗證範圍
12.6 示範: 控制 Roles 能前往的地方
12.7 示範: Customized Login Pages
12.8 示範: 處理登入失敗 (第 1 部份:輸入了錯誤的 username 或 password)
12.9 示範: 處理登入失敗 (第 2 部份:某些不被授權的 Roles 前往受管制的頁面)