This document summarizes updates and changes between Spring Boot 1 and Spring Boot 2, including updates to Gradle, Spring Cloud Config Server, Spring Web, Spring Data, Spring Data JPA, Flyway, testing, and configuration property binding. It provides details on specific changes such as dependency and API changes.
This document summarizes updates and changes between Spring Boot 1 and Spring Boot 2, including updates to Gradle, Spring Cloud Config Server, Spring Web, Spring Data, Spring Data JPA, Flyway, testing, and configuration property binding. It provides details on specific changes such as dependency and API changes.
Workshipにおけるレコメンドエンジン実装を公開
※ 株式会社GIGでは毎月社内勉強会を実施しています
GIG inc.
Good is good.
We provide opportunities to the SEKAI by fusing technology and ideas.
テクノロジーとクリエイティブでセカイをより良くする。小さなチームからスタートした多くの先人達が、世界をより豊かなモノに変革してきました。通信、UX、デバイス、技術の変化と共に世界はまだまだ加速度的に変わります。
Good is good. いいものはいい。GIGは、関わったユーザーやクライアントが前に進める“きっかけ”をつくりつづけます。
■ お問い合せ
https://giginc.co.jp/contact/
60. 動作概要
<<controller>>
Model
HomeController
"serverTime"
Date
home()
③
(現在の日時)
Dispatcher
ブラウザ
①
Servlet
(ほか色々)
<<jsp>>
/WEB-INF/views/home.jsp
⑥
60
61. HomeController
DIコンテナにより
自動で読み込まれる
(component-scan)
HTTPメソッドがGETで
@Controller 「/」へアクセスした際に
public class HomeController { 実行される
@RequestMapping(value = "/", method = GET)
public String home(Model model) { Viewに渡したいオブジェクトを
Date date = new Date(); 設定する
model.addAttribute("serverTime", date);
return "home";
}
View名をreturnする
}
※少し手を加えシンプルにしています
61
62. home.jsp
<html>
<head>
<title>Home</title> Modelに設定したオブジェクトは
</head> 自動的にHttpServletRequestに
設定されている
<body>
<h1>Hello world! </h1>
<p>The time on the server is ${serverTime}.</p>
</body>
</html>
※少し手を加えシンプルにしています
62
64. 引数色々①
// リクエストパラメータを取得(「/person?id=10」などでアクセス)
@RequestMapping(value = "/person", method=GET)
public String showPerson1 (
@RequestParam("id") int id, Model model) {
Person person = findById(id);
model.addAttribute("person", person);
・・・
// URLの値を取得(「/person/10」などでアクセス)
@RequestMapping(value = "/person/{id}", method=GET)
public String showPerson2(
@PathVariable("id") int id, Model model) {
Person person = findById(id);
model.addAttribute("person", person);
・・・
64