{"id":130,"date":"2019-06-07T10:03:13","date_gmt":"2019-06-07T01:03:13","guid":{"rendered":"http:\/\/2019se3.satoshis.jp\/?p=130"},"modified":"2019-06-07T12:46:57","modified_gmt":"2019-06-07T03:46:57","slug":"6%e6%9c%887%e6%97%a5","status":"publish","type":"post","link":"https:\/\/2019se3.satoshis.jp\/?p=130","title":{"rendered":"6\u67087\u65e5"},"content":{"rendered":"<p>Git\u306b\u30b3\u30df\u30c3\u30c8\u3059\u308b\u524d\u306b\u3001.gitignore\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b\u3002<br \/>\n\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30fb\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u30fc\u306e\u53f3\u4e0a\u306e\u25bd\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u300c\u30d5\u30a3\u30eb\u30bf\u30fc\u304a\u3088\u3073\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u300d\u3092\u9078\u629e\u3059\u308b\u3002<br \/>\n\u300c.*\u30ea\u30bd\u30fc\u30b9\u300d\u306e\u30c1\u30a7\u30c3\u30af\u3092\u5916\u3057\u3066OK\u3059\u308b\u3002<br \/>\n.gitignore\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; highlight: [4,5,6]; title: ; notranslate\" title=\"\">\r\nHELP.md\r\n\/target\/\r\n!.mvn\/wrapper\/maven-wrapper.jar\r\n\/.mvn\/\r\nmvnw\r\nmvnw.cmd\r\n\r\n### STS ###\r\n.apt_generated\r\n.classpath\r\n.factorypath\r\n.project\r\n.settings\r\n.springBeans\r\n.sts4-cache\r\n:\r\n:\r\n<\/pre>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066[\u30c1\u30fc\u30e0]-[\u30b3\u30df\u30c3\u30c8]\u3092\u9078\u629e\u3059\u308b\u3002<br \/>\n\u30b3\u30df\u30c3\u30c8\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3057\u3066\u3001\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u5165\u529b\u3057\u3001\u53f3\u4e0b\u306e\u300c\u30b3\u30df\u30c3\u30c8\u300d\u3092\u30af\u30ea\u30c3\u30af\u3002<br \/>\nGit\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30b3\u30df\u30c3\u30c8\u3055\u308c\u308b\u3002<\/p>\n<h3>\u30d5\u30a9\u30ef\u30fc\u30c9\u3068\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/h3>\n<p>\u30c6\u30ad\u30b9\u30c8\u3067\u306fp.158\u306e\u30ea\u30b9\u30c83-23\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u5185\u5bb9\u3002<br \/>\n\u3053\u3053\u3067\u306f\u3001IndexController\u306b\u8ffd\u52a0\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"brush: java; highlight: [57,58,59,60,61,62,63,64,65]; title: ; notranslate\" title=\"\">\r\npackage jp.abc;\r\n\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.ui.Model;\r\nimport org.springframework.web.bind.annotation.PathVariable;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.bind.annotation.RequestParam;\r\nimport org.springframework.web.servlet.ModelAndView;\r\n\r\n@Controller\r\npublic class IndexController {\r\n\r\n\t@RequestMapping(&quot;\/index\/{num}&quot;)\r\n\tpublic String index(@PathVariable int num, Model model) {\r\n\t\tint res = 0;\r\n\t\tfor (int i = 1; i &lt;= num; i++) {\r\n\t\t\tres += i;\r\n\t\t}\r\n\t\tmodel.addAttribute(&quot;msg&quot;, &quot;total: &quot; + res);\r\n\t\treturn &quot;index&quot;;\r\n\t}\r\n\r\n\t@RequestMapping(&quot;\/mav\/{num}&quot;)\r\n\tpublic ModelAndView mav(@PathVariable int num, ModelAndView mav) {\r\n\t\tint res = 0;\r\n\t\tfor (int i = 1; i &lt;= num; i++) {\r\n\t\t\tres += i;\r\n\t\t}\r\n\t\tmav.addObject(&quot;msg&quot;, &quot;total: &quot; + res);\r\n\t\tmav.setViewName(&quot;index&quot;);\r\n\t\treturn mav;\r\n\t}\r\n\r\n\t@RequestMapping(value=&quot;\/form1&quot;, method=RequestMethod.GET)\r\n\tpublic ModelAndView form1(ModelAndView mav) {\r\n\t\tmav.setViewName(&quot;form1&quot;);\r\n\t\tmav.addObject(&quot;msg&quot;, &quot;\u304a\u540d\u524d\u3092\u66f8\u3044\u3066\u9001\u4fe1\u3057\u3066\u304f\u3060\u3055\u3044&quot;);\r\n\t\treturn mav;\r\n\t}\r\n\r\n\t@RequestMapping(value=&quot;\/form1&quot;, method=RequestMethod.POST)\r\n\tpublic ModelAndView send(@RequestParam(&quot;text1&quot;)String str,\r\n\t\t\t@RequestParam(&quot;text2&quot;)String str2,\r\n\t\t\tModelAndView mav) {\r\n\t\tint p = (str + str2).hashCode() % 101;\r\n\t\tp = Math.abs(p);\r\n\t\tmav.addObject(&quot;msg&quot;, &quot;\u3053\u3093\u306b\u3061\u306f&quot; + str + &quot;\u3055\u3093\uff01&quot;);\r\n\t\tmav.addObject(&quot;result&quot;, str + &quot;\u3055\u3093\u306e&quot;\r\n\t\t\t\t\t\t\t+ str2 + &quot;\u5ea6\u306f\u3001&quot; + p +&quot;\uff05\u3067\u3059\u3002&quot;);\r\n\t\tmav.addObject(&quot;value&quot;, str);\r\n\t\tmav.addObject(&quot;text2&quot;, str2);\r\n\t\tmav.setViewName(&quot;form1&quot;);\r\n\t\treturn mav;\r\n\t}\r\n\r\n\t@RequestMapping(&quot;\/other&quot;)\r\n\tpublic String other() {\r\n\t\treturn &quot;redirect:\/&quot;;\r\n\t}\r\n\r\n\t@RequestMapping(&quot;\/home&quot;)\r\n\tpublic String home() {\r\n\t\treturn &quot;forward:\/&quot;;\r\n\t}\r\n\r\n}\r\n<\/pre>\n<h3>Thymeleaf\u3092\u30de\u30b9\u30bf\u30fc\u3059\u308b<\/h3>\n<p>IndexController\u306e\u6700\u5f8c\u306b\u4ee5\u4e0b\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n\t@RequestMapping(&quot;\/date&quot;)\r\n\tpublic String date() {\r\n\t\treturn &quot;index&quot;;\r\n\t}\r\n<\/pre>\n<p>index.html \u306b1\u884c\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 21; highlight: [24]; title: ; notranslate\" title=\"\">\r\n&lt;h1&gt;helo page&lt;\/h1&gt;\r\n&lt;p class=&quot;msg&quot;&gt;this is Thymeleaf sample page&lt;\/p&gt;\r\n&lt;p class=&quot;msg&quot; th:text=&quot;${msg}&quot;&gt;&lt;\/p&gt;\r\n&lt;p th:text=&quot;${new java.util.Date().toString()}&quot;&gt;&lt;\/p&gt;\r\n<\/pre>\n<h4>\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/h4>\n<p>Thymeleaf\u306b\u306f\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u4f7f\u3063\u3066\u307f\u308b\u3002<br \/>\nindex.html \u306b\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 26; title: ; notranslate\" title=\"\">\r\n&lt;p th:text=&quot;${#dates.format(new java.util.Date(), 'dd\/MMM\/yyyy HH:mm')}&quot;&gt;&lt;\/p&gt;\r\n&lt;p th:text=&quot;${#numbers.formatInteger(1234, 7)}&quot;&gt;&lt;\/p&gt;\r\n&lt;p th:text=&quot;${#strings.toUpperCase('Welcome to Spring')}&quot;&gt;&lt;\/p&gt;\r\n<\/pre>\n<p><img src=\"http:\/\/2019se3.satoshis.jp\/wp-content\/uploads\/2019\/06\/utiliti-objects.png\" alt=\"\" width=\"400\" class=\"alignnone size-full wp-image-137\" srcset=\"https:\/\/2019se3.satoshis.jp\/wp-content\/uploads\/2019\/06\/utiliti-objects.png 627w, https:\/\/2019se3.satoshis.jp\/wp-content\/uploads\/2019\/06\/utiliti-objects-300x249.png 300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<h4>\u30d1\u30e9\u30e1\u30fc\u30bf\u3078\u306e\u30a2\u30af\u30bb\u30b9<\/h4>\n<p>index.html \u306b\u3055\u3089\u306b\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 29; title: ; notranslate\" title=\"\">\r\n&lt;p th:text=&quot;'from parameter... id=' + ${param.id[0]}&quot;&gt;&lt;\/p&gt;\r\n&lt;p th:text=&quot;'name=' + ${param.name[0]}&quot;&gt;&lt;\/p&gt;\r\n<\/pre>\n<p>URL\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u3068\u3001\u305d\u306e\u5024\u304c\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\n<p>http:\/\/localhost:8080\/date?id=12345&#038;name=taro<\/p>\n<h4>\u9078\u629e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u5909\u6570\u5f0f<\/h4>\n<p>\u65e2\u5b58\u306e\u30b3\u30fc\u30c9\u304c\u9577\u304f\u306a\u3063\u3066\u304d\u305f\u306e\u3067\u3001\u65b0\u3057\u304f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<p>ObjectController.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.abc;\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 ObjectController {\r\n\t@RequestMapping(&quot;\/obj&quot;)\r\n\tpublic ModelAndView index(ModelAndView mav) {\r\n\t\tmav.setViewName(&quot;obj&quot;);\r\n\t\tmav.addObject(&quot;msg&quot;, &quot;current data&quot;);\r\n\t\tDataObject obj = new DataObject(123, &quot;hanako&quot;, &quot;hanako@flower&quot;);\r\n\t\tmav.addObject(&quot;obj&quot;, obj);\r\n\t\treturn mav;\r\n\t}\r\n}\r\n<\/pre>\n<p>HTML\u3082\u65b0\u898f\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<p>obj.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;\u9078\u629e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8&lt;\/title&gt;\r\n&lt;style type=&quot;text\/css&quot;&gt;\r\nh1 {\r\n  font-size: 18pt;\r\n  font-weight: bold;\r\n  color: gray;\r\n}\r\nbody {\r\n  font-size: 13pt;\r\n  color: gray;\r\n  margin: 5px 25px;\r\n}\r\ntr {\r\n  margin: 5x;\r\n}\r\nth {\r\n  padding: 5px;\r\n  color: white;\r\n  background: darkgray;\r\n}\r\ntd {\r\n  padding: 5px;\r\n  color: black;\r\n  background: #f0f0f0;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;\u9078\u629e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5909\u6570\u5f0f&lt;\/h1&gt;\r\n&lt;p th:text=&quot;${msg}&quot;&gt;&lt;\/p&gt;\r\n&lt;table th:object=&quot;${obj}&quot;&gt;\r\n  &lt;tr&gt;&lt;th&gt;ID&lt;\/th&gt;&lt;td th:text=&quot;*{id}&quot;&gt;&lt;\/td&gt;&lt;\/tr&gt;\r\n  &lt;tr&gt;&lt;th&gt;NAME&lt;\/th&gt;&lt;td th:text=&quot;*{name}&quot;&gt;&lt;\/td&gt;&lt;\/tr&gt;\r\n  &lt;tr&gt;&lt;th&gt;MAIL&lt;\/th&gt;&lt;td th:text=&quot;*{value}&quot;&gt;&lt;\/td&gt;&lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h4>\u30ea\u30c6\u30e9\u30eb\u7f6e\u63db<\/h4>\n<p>obj.html \u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;div th:object=&quot;${obj}&quot;&gt;\r\n  &lt;p th:text=&quot;|my name is *{name}. mail address is *{value}.|&quot;&gt;message.&lt;\/p&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<h4>HTML\u30b3\u30fc\u30c9\u306e\u51fa\u529b<\/h4>\n<p>ObjectController \u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; first-line: 10; highlight: [15]; title: ; notranslate\" title=\"\">\r\n\tpublic ModelAndView index(ModelAndView mav) {\r\n\t\tmav.setViewName(&quot;obj&quot;);\r\n\t\tmav.addObject(&quot;msg&quot;, &quot;current data&quot;);\r\n\t\tDataObject obj = new DataObject(123, &quot;hanako&quot;, &quot;hanako@flower&quot;);\r\n\t\tmav.addObject(&quot;obj&quot;, obj);\r\n\t\tmav.addObject(&quot;code&quot;, &quot;msg1&lt;hr \/&gt;msg2&lt;br \/&gt;msg3&quot;);\r\n\t\treturn mav;\r\n\t}\r\n<\/pre>\n<p>obj.html \u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 45; highlight: [45]; title: ; notranslate\" title=\"\">\r\n&lt;p th:text=&quot;${code}&quot;&gt;message.&lt;\/p&gt;\r\n<\/pre>\n<h4>\u6761\u4ef6\u5f0f<\/h4>\n<p>IndexController\u306e date() \u30e1\u30bd\u30c3\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u308b\u3002<\/p>\n<pre class=\"brush: java; first-line: 67; title: ; notranslate\" title=\"\">\r\n\t@RequestMapping(&quot;\/date&quot;)\r\n\tpublic ModelAndView date(\r\n\t\t\t@RequestParam(&quot;id&quot;)int id,\r\n\t\t\tModelAndView mav) {\r\n\t\tmav.setViewName(&quot;index&quot;);\r\n\t\tmav.addObject(&quot;id&quot;, id);\r\n\t\tmav.addObject(&quot;check&quot;, id % 2 == 0);\r\n\t\tmav.addObject(&quot;trueVal&quot;, &quot;Even number!&quot;);\r\n\t\tmav.addObject(&quot;falseVal&quot;, &quot;Odd number..&quot;);\r\n\t\treturn mav;\r\n\t}\r\n<\/pre>\n<p>index.html \u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 33; title: ; notranslate\" title=\"\">\r\n&lt;p th:text=&quot;${id} + ' is ' + (${check} ? ${trueVal} : ${falseVal})&quot;&gt;&lt;\/p&gt;\r\n<\/pre>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Git\u306b\u30b3\u30df\u30c3\u30c8\u3059\u308b\u524d\u306b\u3001.gitignore\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b\u3002 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30fb\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u30fc\u306e\u53f3\u4e0a\u306e\u25bd\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u300c\u30d5\u30a3\u30eb\u30bf\u30fc\u304a\u3088\u3073\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u300d\u3092\u9078\u629e\u3059\u308b\u3002 \u300c.*\u30ea\u30bd\u30fc\u30b9\u300d\u306e\u30c1\u30a7\u30c3\u30af\u3092\u5916\u3057\u3066OK\u3059\u308b\u3002 .gi &hellip; <a href=\"https:\/\/2019se3.satoshis.jp\/?p=130\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;6\u67087\u65e5&#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":[],"categories":[5,1,3],"tags":[],"_links":{"self":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/130"}],"collection":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=130"}],"version-history":[{"count":12,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/130\/revisions"}],"predecessor-version":[{"id":143,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/130\/revisions\/143"}],"wp:attachment":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}