{"id":70,"date":"2019-12-05T13:23:17","date_gmt":"2019-12-05T04:23:17","guid":{"rendered":"http:\/\/kpc2019.satoshis.jp\/?p=70"},"modified":"2019-12-05T16:28:43","modified_gmt":"2019-12-05T07:28:43","slug":"%e6%9c%ac%e6%a3%9aweb%e3%82%a2%e3%83%97%e3%83%aa%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/kpc2019.satoshis.jp\/?p=70","title":{"rendered":"\u672c\u68daWeb\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u308b"},"content":{"rendered":"<p><strong>\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b<\/strong><\/p>\n<p>\u540d\u524d\uff1a bookshelf<br \/>\n\u30b0\u30eb\u30fc\u30d7\uff1a jp.or.jeed<br \/>\n\u30d1\u30c3\u30b1\u30fc\u30b8\uff1a jp.or.jeed<\/p>\n<p>pom.xml \u306b demo \u3067\u8ffd\u52a0\u3057\u305f\u90e8\u5206\u3092\u540c\u69d8\u306b\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; highlight: [39,40,41,42,43,44,45,46,47,48,49,50,51,52]; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\r\n&lt;project xmlns=&quot;http:\/\/maven.apache.org\/POM\/4.0.0&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;\r\n\txsi:schemaLocation=&quot;http:\/\/maven.apache.org\/POM\/4.0.0 https:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd&quot;&gt;\r\n\t&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n\t&lt;parent&gt;\r\n\t\t&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n\t\t&lt;artifactId&gt;spring-boot-starter-parent&lt;\/artifactId&gt;\r\n\t\t&lt;version&gt;2.2.1.RELEASE&lt;\/version&gt;\r\n\t\t&lt;relativePath\/&gt; &lt;!-- lookup parent from repository --&gt;\r\n\t&lt;\/parent&gt;\r\n\t&lt;groupId&gt;jp.or.jeed&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;bookshelf&lt;\/artifactId&gt;\r\n\t&lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n\t&lt;name&gt;bookshelf&lt;\/name&gt;\r\n\t&lt;description&gt;Demo project for Spring Boot&lt;\/description&gt;\r\n\r\n\t&lt;properties&gt;\r\n\t\t&lt;java.version&gt;1.8&lt;\/java.version&gt;\r\n\t&lt;\/properties&gt;\r\n\r\n\t&lt;dependencies&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-boot-starter-test&lt;\/artifactId&gt;\r\n\t\t\t&lt;scope&gt;test&lt;\/scope&gt;\r\n\t\t\t&lt;exclusions&gt;\r\n\t\t\t\t&lt;exclusion&gt;\r\n\t\t\t\t\t&lt;groupId&gt;org.junit.vintage&lt;\/groupId&gt;\r\n\t\t\t\t\t&lt;artifactId&gt;junit-vintage-engine&lt;\/artifactId&gt;\r\n\t\t\t\t&lt;\/exclusion&gt;\r\n\t\t\t&lt;\/exclusions&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;\/artifactId&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-boot-starter-data-jpa&lt;\/artifactId&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.hsqldb&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;hsqldb&lt;\/artifactId&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\r\n\t&lt;\/dependencies&gt;\r\n\r\n\t&lt;build&gt;\r\n\t\t&lt;plugins&gt;\r\n\t\t\t&lt;plugin&gt;\r\n\t\t\t\t&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n\t\t\t\t&lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;\r\n\t\t\t&lt;\/plugin&gt;\r\n\t\t&lt;\/plugins&gt;\r\n\t&lt;\/build&gt;\r\n\r\n&lt;\/project&gt;\r\n<\/pre>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057[Maven]-[\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u66f4\u65b0]\u3092\u9078\u629e\u3059\u308b\u3002<br \/>\n\u51e6\u7406\u304c\u7d42\u308f\u3063\u305f\u3089\u518d\u5ea6\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057[\u5b9f\u884c]-[maven install]\u3092\u9078\u629e\u3059\u308b\u3002<\/p>\n<p>\u300cBUILD SUCCESS\u300d\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308c\u3070OK\uff01<\/p>\n<p>\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b<\/p>\n<p>src\/main\/resources<br \/>\n\u3000\u2514templates<br \/>\n\u3000\u3000\u2514index.html<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;\u672c\u68da\u30a2\u30d7\u30ea&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;\u672c\u68da\u30a2\u30d7\u30ea&lt;\/h1&gt;\r\n&lt;p&gt;\u672c\u68da\u306b\u672c\u3092\u53ce\u7d0d\u3059\u308b\u30a2\u30d7\u30ea\u3092\u4f5c\u308a\u307e\u3059\u3002&lt;\/p&gt;\r\n&lt;p th:text=&quot;${msg}&quot;&gt;${msg}&lt;\/p&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>index.html \u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u4f5c\u6210\u3059\u308b\u3002<br \/>\nsrc\/main\/java<br \/>\n\u3000\u2514jp.or.jeed<br \/>\n\u3000\u3000\u2514IndexController.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.or.jeed;\r\n\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\n\r\n@Controller\r\npublic class IndexController {\r\n\r\n\t@RequestMapping(&quot;\/&quot;)\r\n\tpublic String index() {\r\n\t\treturn &quot;index&quot;;\r\n\t}\r\n}\r\n<\/pre>\n<p><strong>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092Git\u3067\u7ba1\u7406\u3059\u308b<\/strong><br \/>\nSpringBoot\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u52d5\u3044\u3066\u3044\u305f\u3089\u3001\u4e00\u65e6\u505c\u6b62\u3059\u308b\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057[\u30c1\u30fc\u30e0]-[\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u5171\u7528]\u3092\u9078\u629e\u3059\u308b\u3002<br \/>\n\u30ea\u30dd\u30b8\u30c8\u30ea\u30fc\u30bf\u30a4\u30d7\u306f\u300cGit\u300d\u3092\u9078\u629e\u3057\u3066\u300c\u6b21\u3078\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3002<br \/>\n\u30ea\u30dd\u30b8\u30c8\u30ea\u30fc\u306e\u53f3\u5074\u306e\u300c\u4f5c\u6210\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3002<br \/>\n\u30ea\u30dd\u30b8\u30c8\u30ea\u30fc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u300cZ:\\Java\\git\u300d\u3092\u6307\u5b9a\u3057\u3066\u300c\u5b8c\u4e86\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3002<\/p>\n<p>Git\u3067\u7ba1\u7406\u3055\u308c\u308b\u3068\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u306e\u53f3\u5074\u306b [git master] \u306e\u3088\u3046\u306a\u8868\u793a\u304c\u8ffd\u52a0\u3055\u308c\u308b\u3002<\/p>\n<p><strong>Git\u3067\u7ba1\u7406\u4e0d\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u9664\u5916\u3059\u308b<\/strong><br \/>\n\u30d5\u30a1\u30a4\u30eb\u3092\u9664\u5916\u3059\u308b\u306b\u306f\u3001.gitignore \u30d5\u30a1\u30a4\u30eb\u306b\u9664\u5916\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3059\u308c\u3070\u3088\u3044\u3002<\/p>\n<p><strong>.gitignore \u3092\u898b\u3048\u308b\u3088\u3046\u306b\u3059\u308b<\/strong><br \/>\n.gitignore \u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3048\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u898b\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306b\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u30fc\u306e\u53f3\u4e0a\u306b\u3042\u308b\u300c\u25bd\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3002<br \/>\n\u300c\u30d5\u30a3\u30eb\u30bf\u30fc\u304a\u3088\u3073\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u300d\u3092\u9078\u629e\u3059\u308b\u3002<\/p>\n<p>\u300c.*\u30ea\u30bd\u30fc\u30b9\u300d\u306e\u30c1\u30a7\u30c3\u30af\u3092\u306f\u305a\u3057\u3066\u300cOK\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/kpc2019.satoshis.jp\/wp-content\/uploads\/2019\/12\/filter.png\" alt=\"\" width=\"480\" height=\"468\" class=\"alignnone size-full wp-image-81\" \/><\/p>\n<p><strong>.gitignore\u3092\u7de8\u96c6\u3059\u308b<\/strong><br \/>\n.gitignore \u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u3066\u958b\u304f\u3002<br \/>\n3\u884c\u76ee\uff08target\/ \u306e\u4e0b\uff09\u306b\u300c.mvn\/\u300d\u3068\u300cmvnw\u300d\u3068\u300cmvnw.cmd\u300d\u3092\u8ffd\u52a0\u3057\u3066\u4fdd\u5b58\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; highlight: [3,4,5]; title: ; notranslate\" title=\"\">\r\nHELP.md\r\ntarget\/\r\n.mvn\/\r\nmvnw\r\nmvnw.cmd\r\n!.mvn\/wrapper\/maven-wrapper.jar\r\n!**\/src\/main\/**\r\n!**\/src\/test\/**\r\n\r\n\uff08\u4ee5\u4e0b\u7565\uff09\r\n<\/pre>\n<p><strong>Git\u306b\u73fe\u5728\u306e\u30bd\u30fc\u30b9\u3092\u30b3\u30df\u30c3\u30c8\u3059\u308b<\/strong><br \/>\n\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057[\u30c1\u30fc\u30e0]-[\u30b3\u30df\u30c3\u30c8]\u3092\u9078\u629e\u3059\u308b\u3002<br \/>\n\u300cGit\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u300d\u30bf\u30d6\u304c\u958b\u304f\u306e\u3067\u3001Git\u3067\u7ba1\u7406\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u300c\u30b9\u30c6\u30fc\u30b8\u3055\u308c\u305f\u5909\u66f4\u300d\u306b\u79fb\u52d5\u3059\u308b\u3002<\/p>\n<p>\u53f3\u5074\u306e\u300c\u30b3\u30df\u30c3\u30c8\u30fb\u30e1\u30c3\u30bb\u30fc\u30b8\u300d\u306b\u300cfirst commit\u300d\u306a\u3069\u306e\u30b3\u30e1\u30f3\u30c8\u3092\u5165\u529b\u3059\u308b\u3002<br \/>\n\u53f3\u4e0b\u306e\u300c\u30b3\u30df\u30c3\u30c8\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3002<\/p>\n<p>\u203b\u300c\u30b3\u30df\u30c3\u30c8\u304a\u3088\u3073\u30d7\u30c3\u30b7\u30e5\u300d\u306f\u4eca\u56de\u306f\u4f7f\u308f\u306a\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/kpc2019.satoshis.jp\/wp-content\/uploads\/2019\/12\/git-staging.png\" alt=\"\" width=\"740\" height=\"505\" class=\"alignnone size-full wp-image-85\" \/><\/p>\n<p><strong>\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306b\u672c\u68da\u30ea\u30b9\u30c8\u3078\u306e\u30ea\u30f3\u30af\u3092\u8ffd\u52a0\u3059\u308b<\/strong><\/p>\n<pre class=\"brush: xml; highlight: [13]; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;\u672c\u68da\u30a2\u30d7\u30ea&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;\u672c\u68da\u30a2\u30d7\u30ea&lt;\/h1&gt;\r\n&lt;p&gt;\u672c\u68da\u306b\u672c\u3092\u53ce\u7d0d\u3059\u308b\u30a2\u30d7\u30ea\u3092\u4f5c\u308a\u307e\u3059\u3002&lt;\/p&gt;\r\n\r\n\r\n&lt;a href=&quot;\/bookshelf&quot;&gt;\u672c\u68da\u30ea\u30b9\u30c8&lt;\/a&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>\u672c\u68da\u30ea\u30b9\u30c8\u306e\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002<\/p>\n<p>\u52d5\u304f\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306b\u3001HTML\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3068\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<p>BookshelfController.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.or.jeed;\r\n\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\n\r\n@Controller\r\npublic class BookshelfController {\r\n\r\n\t@RequestMapping(&quot;\/bookshelf&quot;)\r\n\tpublic String list() {\r\n\t\treturn &quot;bookshelf&quot;;\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>bookshelf.html<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;\u672c\u68da\u30ea\u30b9\u30c8&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;\u672c\u68da\u30ea\u30b9\u30c8&lt;\/h1&gt;\r\n&lt;p&gt;\u672c\u68da\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002&lt;\/p&gt;\r\n\r\n\r\n&lt;a href=&quot;\/&quot;&gt;\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306b\u623b\u308b&lt;\/a&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>\u672c\u68da\u3092\u8ffd\u52a0\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044\uff01<\/strong><\/p>\n<p>HTML\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u30d5\u30a9\u30fc\u30e0\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; highlight: [13,14,15,16]; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;\u672c\u68da\u30ea\u30b9\u30c8&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;\u672c\u68da\u30ea\u30b9\u30c8&lt;\/h1&gt;\r\n&lt;p&gt;\u672c\u68da\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002&lt;\/p&gt;\r\n\r\n\r\n&lt;form action=&quot;\/bookshelf&quot; method=&quot;post&quot; th:object=&quot;${bookshelf}&quot;&gt;\r\n  &lt;input type=&quot;text&quot; name=&quot;name&quot; th:value=&quot;*{name}&quot; \/&gt;\r\n  &lt;input type=&quot;submit&quot; \/&gt;\r\n&lt;\/form&gt;\r\n\r\n\r\n\r\n&lt;a href=&quot;\/&quot;&gt;\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306b\u623b\u308b&lt;\/a&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>\u3053\u306e\u72b6\u614b\u3067\u300chttp:\/\/localhost:8080\/bookshelf\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\norg.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: &quot;name&quot; (template: &quot;bookshelf&quot; - line 14, col 34)\r\n\tat org.thymeleaf.spring5.expression.SPELVariableExpressionEvaluator.evaluate(SPELVariableExpressionEvaluator.java:290) ~&#x5B;thymeleaf-spring5-3.0.11.RELEASE.jar:3.0.11.RELEASE]\r\n\tat org.thymeleaf.standard.expression.SelectionVariableExpression.executeSelectionVariableExpression(SelectionVariableExpression.java:158) ~&#x5B;thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]\r\n\tat org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:92) ~&#x5B;thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]\r\n :\r\n\uff08\u4ee5\u4e0b\u7565\uff09\r\n<\/pre>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u304b\u3089HTML\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b bookshelf \u3092\u6e21\u305b\u308b\u3088\u3046\u306b\u3059\u308b\u3002<br \/>\nBookshelf \u30af\u30e9\u30b9\u3092\u4f5c\u3063\u3066\u306a\u3044\u306e\u3067\u3001new Bookshelf() \u306e\u3068\u3053\u308d\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u8d64\u7dda\u304c\u51fa\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.or.jeed;\r\n\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.servlet.ModelAndView;\r\n\r\n@Controller\r\npublic class BookshelfController {\r\n\r\n\t@RequestMapping(&quot;\/bookshelf&quot;)\r\n\tpublic ModelAndView list(ModelAndView mav) {\r\n\t\tmav.setViewName(&quot;bookshelf&quot;);\r\n\t\tmav.addObject(&quot;bookshelf&quot;, new Bookshelf());\r\n\t\treturn mav;\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u308b new Bookshelf() \u306e\u4e0a\u306b\u30de\u30a6\u30b9\u30ab\u30fc\u30bd\u30eb\u3092\u79fb\u52d5\u3059\u308b\u3068\u3001\u30af\u30a4\u30c3\u30af\u30d5\u30a3\u30c3\u30af\u30b9\u304c\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\n\u300c\u30af\u30e9\u30b9 Bookshelf \u3092\u4f5c\u6210\u3057\u307e\u3059\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30af\u30e9\u30b9\u65b0\u898f\u4f5c\u6210\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u300c\u5b8c\u4e86\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3002<\/p>\n<p>Bookshelf\u30af\u30e9\u30b9\u5185\u306b name \u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.or.jeed;\r\n\r\npublic class Bookshelf {\r\n    private String name;\r\n}\r\n<\/pre>\n<p>\u30e1\u30cb\u30e5\u30fc\u30d0\u30fc\u304b\u3089[\u30bd\u30fc\u30b9]-[getter \u304a\u3088\u3073 setter \u306e\u751f\u6210\u300d\u3092\u9078\u629e\u3059\u308b\u3002<br \/>\nname \u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u3066\u300cOK\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001Bookshelf\u306b\u30b3\u30fc\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.or.jeed;\r\n\r\npublic class Bookshelf {\r\n\tprivate String name;\r\n\r\n\tpublic String getName() {\r\n\t\treturn name;\r\n\t}\r\n\r\n\tpublic void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}\r\n}\r\n<\/pre>\n<p>\u9001\u4fe1\u30dc\u30bf\u30f3\u306e\u6587\u5b57\u5217\u3092\u5909\u66f4\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; highlight: [15]; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;\u672c\u68da\u30ea\u30b9\u30c8&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;\u672c\u68da\u30ea\u30b9\u30c8&lt;\/h1&gt;\r\n&lt;p&gt;\u672c\u68da\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002&lt;\/p&gt;\r\n\r\n\r\n&lt;form action=&quot;\/bookshelf&quot; method=&quot;post&quot; th:object=&quot;${bookshelf}&quot;&gt;\r\n  &lt;input type=&quot;text&quot; name=&quot;name&quot; th:value=&quot;*{name}&quot; \/&gt;\r\n  &lt;input type=&quot;submit&quot; value=&quot;\u672c\u68da\u3092\u4f5c\u6210&quot; \/&gt;\r\n&lt;\/form&gt;\r\n\r\n\r\n\r\n&lt;a href=&quot;\/&quot;&gt;\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306b\u623b\u308b&lt;\/a&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u672c\u68da\u30ea\u30b9\u30c8\u304b\u3089\u306e\u30c7\u30fc\u30bf\u3092\u53d7\u3051\u53d6\u3063\u3066\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u8868\u793a\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.or.jeed;\r\n\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.ModelAttribute;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.servlet.ModelAndView;\r\n\r\n@Controller\r\npublic class BookshelfController {\r\n\r\n\t@RequestMapping(value = &quot;\/bookshelf&quot;, method = RequestMethod.GET)\r\n\tpublic ModelAndView list(ModelAndView mav) {\r\n\t\tmav.setViewName(&quot;bookshelf&quot;);\r\n\t\tmav.addObject(&quot;bookshelf&quot;, new Bookshelf());\r\n\t\treturn mav;\r\n\t}\r\n\r\n\t@RequestMapping(value = &quot;\/bookshelf&quot;, method = RequestMethod.POST)\r\n\tpublic ModelAndView post(ModelAndView mav,\r\n\t\t\t@ModelAttribute(&quot;bookshelf&quot;) Bookshelf bookshelf) {\r\n\t\tSystem.out.println(&quot;\u672c\u68da\u306e\u540d\u524d\u306f &quot; + bookshelf.getName());\r\n\t\treturn mav;\r\n\t}\r\n}\r\n<\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9 HSQLDB \u306b\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<p>src\/main\/resources<br \/>\n\u3000\u2514application.properties<\/p>\n<p>application.properties \u30d5\u30a1\u30a4\u30eb\u306b\u8a2d\u5b9a\u3092\u66f8\u304f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nspring.datasource.url=jdbc:hsqldb:file:.\/db\/bookshelf\r\nspring.datasource.username=SA\r\nspring.datasource.password=\r\nspring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver\r\n<\/pre>\n<p>Bookshelf \u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u683c\u7d0d\u3067\u304d\u308b\u3088\u3046\u306b\u4fee\u6b63\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.or.jeed;\r\n\r\nimport javax.persistence.Column;\r\nimport javax.persistence.Entity;\r\nimport javax.persistence.GeneratedValue;\r\nimport javax.persistence.Id;\r\nimport javax.validation.constraints.NotEmpty;\r\nimport javax.validation.constraints.NotNull;\r\n\r\n@Entity\r\npublic class Bookshelf {\r\n\t@Id\r\n\t@GeneratedValue\r\n\t@Column\r\n\t@NotNull\r\n\tprivate long id;\r\n\r\n\t@Column\r\n\t@NotEmpty\r\n\tprivate String name;\r\n\r\n\tpublic long getId() {\r\n\t\treturn id;\r\n\t}\r\n\r\n\tpublic void setId(long id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\r\n\tpublic String getName() {\r\n\t\treturn name;\r\n\t}\r\n\r\n\tpublic void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}\r\n}\r\n<\/pre>\n<p>Bookshelf \u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306e\u4ed5\u4e8b\u3092\u3057\u3066\u304f\u308c\u308b\u30af\u30e9\u30b9\uff08\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\uff09\u3092\u7528\u610f\u3059\u308b\u3002<\/p>\n<p>BookshelfRepository.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.or.jeed;\r\n\r\nimport org.springframework.data.jpa.repository.JpaRepository;\r\n\r\npublic interface BookshelfRepository extends JpaRepository&lt;Bookshelf, Long&gt; {\r\n\r\n}\r\n<\/pre>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u3063\u305f\u306e\u3067\u3001\u305d\u308c\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u4f7f\u3063\u3066\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"brush: java; highlight: [15,16,22,23,30,31]; title: ; notranslate\" title=\"\">\r\npackage jp.or.jeed;\r\n\r\nimport java.util.List;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.ModelAttribute;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.servlet.ModelAndView;\r\n\r\n@Controller\r\npublic class BookshelfController {\r\n\r\n\t@Autowired\r\n\tprivate BookshelfRepository repository;\r\n\r\n\t@RequestMapping(value = &quot;\/bookshelf&quot;, method = RequestMethod.GET)\r\n\tpublic ModelAndView list(ModelAndView mav) {\r\n\t\tmav.setViewName(&quot;bookshelf&quot;);\r\n\t\tmav.addObject(&quot;bookshelf&quot;, new Bookshelf());\r\n\t\tList&lt;Bookshelf&gt; list = repository.findAll();\r\n\t\tmav.addObject(&quot;list&quot;, list);\r\n\t\treturn mav;\r\n\t}\r\n\r\n\t@RequestMapping(value = &quot;\/bookshelf&quot;, method = RequestMethod.POST)\r\n\tpublic ModelAndView post(ModelAndView mav,\r\n\t\t\t@ModelAttribute(&quot;bookshelf&quot;) Bookshelf bookshelf) {\r\n\t\trepository.saveAndFlush(bookshelf);\r\n\t\treturn new ModelAndView(&quot;redirect:\/bookshelf&quot;);\r\n\t}\r\n}\r\n<\/pre>\n<p>HTML\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u53d7\u3051\u53d6\u3063\u305f list \u3092\u8868\u793a\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; highlight: [18,19,20,21,22,23,24,25,26,27]; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;\u672c\u68da\u30ea\u30b9\u30c8&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;\u672c\u68da\u30ea\u30b9\u30c8&lt;\/h1&gt;\r\n&lt;p&gt;\u672c\u68da\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002&lt;\/p&gt;\r\n\r\n\r\n&lt;form action=&quot;\/bookshelf&quot; method=&quot;post&quot; th:object=&quot;${bookshelf}&quot;&gt;\r\n  &lt;input type=&quot;text&quot; name=&quot;name&quot; th:value=&quot;*{name}&quot; \/&gt;\r\n  &lt;input type=&quot;submit&quot; value=&quot;\u672c\u68da\u3092\u4f5c\u6210&quot; \/&gt;\r\n&lt;\/form&gt;\r\n\r\n&lt;hr \/&gt;\r\n&lt;table&gt;\r\n  &lt;tr&gt;\r\n    &lt;th&gt;ID&lt;\/th&gt;&lt;th&gt;\u672c\u68da\u306e\u540d\u524d&lt;\/th&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr th:each=&quot;bs : ${list}&quot;&gt;\r\n    &lt;td th:text=&quot;${bs.id}&quot;&gt;&lt;\/td&gt;\r\n    &lt;td th:text=&quot;${bs.name}&quot;&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n\r\n\r\n\r\n&lt;a href=&quot;\/&quot;&gt;\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306b\u623b\u308b&lt;\/a&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b \u540d\u524d\uff1a bookshelf \u30b0\u30eb\u30fc\u30d7\uff1a jp.or.jeed \u30d1\u30c3\u30b1\u30fc\u30b8\uff1a jp.or.jeed pom.xml \u306b demo \u3067\u8ffd\u52a0\u3057\u305f\u90e8\u5206\u3092\u540c\u69d8\u306b\u8ffd\u52a0\u3059\u308b\u3002 &lt;?xml versio &hellip; <a href=\"https:\/\/kpc2019.satoshis.jp\/?p=70\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u672c\u68daWeb\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-git","category-spring-boot"],"views":12307,"_links":{"self":[{"href":"https:\/\/kpc2019.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kpc2019.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kpc2019.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kpc2019.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kpc2019.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70"}],"version-history":[{"count":32,"href":"https:\/\/kpc2019.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":104,"href":"https:\/\/kpc2019.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions\/104"}],"wp:attachment":[{"href":"https:\/\/kpc2019.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kpc2019.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kpc2019.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}