{"id":312,"date":"2019-09-05T09:59:38","date_gmt":"2019-09-05T00:59:38","guid":{"rendered":"http:\/\/2019se3.satoshis.jp\/?p=312"},"modified":"2019-09-05T11:16:12","modified_gmt":"2019-09-05T02:16:12","slug":"9%e6%9c%885%e6%97%a5","status":"publish","type":"post","link":"https:\/\/2019se3.satoshis.jp\/?p=312","title":{"rendered":"9\u67085\u65e5"},"content":{"rendered":"<h3>\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/h3>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u78ba\u8a8d\u306e\u305f\u3081\u306b\u4e8c\u56de\u5165\u529b\u3055\u305b\u308b\u3002<br \/>\n\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3067\u3001\u767b\u9332\u3067\u304d\u306a\u3044\u3068\u304d\u306f\u30a8\u30e9\u30fc\u3092\u8868\u793a\u3059\u308b\u3002<\/p>\n<ul>\n<li>\u3059\u3067\u306b\u767b\u9332\u6e08\u307f\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u306e\u5834\u5408<\/li>\n<li>\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e0d\u4e00\u81f4\u306e\u5834\u5408<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u4e0d\u4e00\u81f4\u306e\u30a8\u30e9\u30fc\u3092\u8868\u793a\u3067\u304d\u308b\u3002<br \/>\n\u305f\u3060\u3057\u3001\u767b\u9332\u30dc\u30bf\u30f3\u3092\u62bc\u305b\u308b\u306e\u3067\u3001\u767b\u9332\u306f\u3067\u304d\u3066\u3057\u307e\u3046\u3002<br \/>\n\u4e0d\u4e00\u81f4\u306e\u3068\u304d\u306f\u3001\u767b\u9332\u30dc\u30bf\u30f3\u3092\u62bc\u305b\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<p>newuser.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;\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u767b\u9332&lt;\/title&gt;\r\n    &lt;script src=&quot;https:\/\/code.jquery.com\/jquery-1.12.4.min.js&quot;&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;style type=&quot;text\/css&quot;&gt;\r\n.err {\r\n\tbackground: #ff8080;\r\n}\r\n&lt;\/style&gt;\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\n$(function() {\r\n\t$('[type=password]').on('change', function() {\r\n\t\tvar p1 = $('[name=password]').val();\r\n\t\tvar p2 = $('[name=password2]').val();\r\n\t\tif (p1 != p2) {\r\n\t\t\t$('div.err').text('\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e00\u81f4\u3057\u3066\u3044\u307e\u305b\u3093\u3002');\r\n\t\t} else {\r\n\t\t\t$('div.err').text('');\r\n\t\t}\r\n\t});\r\n})\r\n&lt;\/script&gt;\r\n&lt;body&gt;\r\n    &lt;h1&gt;\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u767b\u9332&lt;\/h1&gt;\r\n    &lt;form th:action=&quot;@{\/newuser}&quot; method=&quot;post&quot;&gt;\r\n        &lt;div&gt;&lt;label&gt;\u30e6\u30fc\u30b6\u540d: &lt;input type=&quot;text&quot; name=&quot;username&quot;\/&gt; &lt;\/label&gt;&lt;\/div&gt;\r\n        &lt;div&gt;&lt;label&gt;\u30d1\u30b9\u30ef\u30fc\u30c9: &lt;input type=&quot;password&quot; name=&quot;password&quot;\/&gt; &lt;\/label&gt;&lt;\/div&gt;\r\n        &lt;div&gt;&lt;label&gt;\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u5165\u529b: &lt;input type=&quot;password&quot; name=&quot;password2&quot;\/&gt; &lt;\/label&gt;&lt;\/div&gt;\r\n        &lt;div class=&quot;err&quot;&gt;&lt;\/div&gt;\r\n        &lt;div&gt;&lt;input type=&quot;submit&quot; value=&quot;\u767b\u9332&quot;\/&gt;&lt;\/div&gt;\r\n    &lt;\/form&gt;\r\n    &lt;a href=&quot;\/&quot;&gt;\u623b\u308b&lt;\/a&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>\u30e6\u30fc\u30b6\u30fc\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u767b\u9332\u3059\u308b\u3068\u304d\u306e\u30a8\u30e9\u30fc<\/strong><br \/>\n\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u767b\u9332\u6642\u306e\u30a8\u30e9\u30fc\u306f\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; highlight: [39,40,41,42,43,44]; title: ; notranslate\" title=\"\">\r\npackage jp.abc;\r\n\r\nimport javax.servlet.http.HttpServletRequest;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.security.core.userdetails.User;\r\nimport org.springframework.security.core.userdetails.User.UserBuilder;\r\nimport org.springframework.security.provisioning.JdbcUserDetailsManager;\r\nimport org.springframework.stereotype.Controller;\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\n\r\n@Controller\r\npublic class MyController {\r\n\t@Autowired\r\n\tprivate JdbcUserDetailsManager userManager;\r\n\r\n\t@RequestMapping(value = &quot;\/&quot;)\r\n\tpublic String index() {\r\n\t\treturn &quot;index&quot;;\r\n\t}\r\n\r\n\t@RequestMapping(value = &quot;\/login&quot;)\r\n\tpublic String login() {\r\n\t\treturn &quot;login&quot;;\r\n\t}\r\n\r\n\t@RequestMapping(value = &quot;\/newuser&quot;, method = RequestMethod.GET)\r\n\tpublic String newuser() {\r\n\t\treturn &quot;newuser&quot;;\r\n\t}\r\n\r\n\t@RequestMapping(value = &quot;\/newuser&quot;, method = RequestMethod.POST)\r\n\tpublic String register(@RequestParam(&quot;username&quot;) String username,\r\n\t\t\t@RequestParam(&quot;password&quot;) String password,\r\n\t\t\tHttpServletRequest req) {\r\n\t\tUserBuilder users = User.withDefaultPasswordEncoder();\r\n\t\ttry {\r\n\t\t\tuserManager.createUser(users.username(username).password(password).roles(&quot;USER&quot;).build());\r\n\t\t} catch (Exception e) {\r\n\t\t\treq.setAttribute(&quot;msg&quot;, &quot;\u305d\u306e\u540d\u524d\u306f\u767b\u9332\u3067\u304d\u307e\u305b\u3093\u3002&quot;);\r\n\t\t\treturn &quot;newuser&quot;;\r\n\t\t}\r\n\t\treturn &quot;login&quot;;\r\n\t}\r\n\r\n\t@RequestMapping(value = &quot;\/mypage&quot;)\r\n\tpublic String top() {\r\n\t\treturn &quot;mypage&quot;;\r\n\t}\r\n}\r\n<\/pre>\n<p>HTML\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 26; highlight: [32]; title: ; notranslate\" title=\"\">\r\n&lt;body&gt;\r\n    &lt;h1&gt;\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u767b\u9332&lt;\/h1&gt;\r\n    &lt;form th:action=&quot;@{\/newuser}&quot; method=&quot;post&quot;&gt;\r\n        &lt;div&gt;&lt;label&gt;\u30e6\u30fc\u30b6\u540d: &lt;input type=&quot;text&quot; name=&quot;username&quot;\/&gt; &lt;\/label&gt;&lt;\/div&gt;\r\n        &lt;div&gt;&lt;label&gt;\u30d1\u30b9\u30ef\u30fc\u30c9: &lt;input type=&quot;password&quot; name=&quot;password&quot;\/&gt; &lt;\/label&gt;&lt;\/div&gt;\r\n        &lt;div&gt;&lt;label&gt;\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u5165\u529b: &lt;input type=&quot;password&quot; name=&quot;password2&quot;\/&gt; &lt;\/label&gt;&lt;\/div&gt;\r\n        &lt;div class=&quot;err&quot; th:text=&quot;${msg}&quot;&gt;&lt;\/div&gt;\r\n        &lt;div&gt;&lt;input type=&quot;submit&quot; value=&quot;\u767b\u9332&quot;\/&gt;&lt;\/div&gt;\r\n    &lt;\/form&gt;\r\n    &lt;a href=&quot;\/&quot;&gt;\u623b\u308b&lt;\/a&gt;\r\n&lt;\/body&gt;\r\n<\/pre>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u306e1\u6587\u5b57\u3092\u5165\u529b\u3059\u308b\u305f\u3073\u306b\u4e0d\u4e00\u81f4\u306e\u30a8\u30e9\u30fc\u3092\u8868\u793a\u3059\u308b\u3002<br \/>\nnewuser.html<\/p>\n<pre class=\"brush: xml; first-line: 13; highlight: [15]; title: ; notranslate\" title=\"\">\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\n$(function() {\r\n\t$('[type=password]').on('keyup', function() {\r\n\t\tvar p1 = $('[name=password]').val();\r\n\t\tvar p2 = $('[name=password2]').val();\r\n\t\tif (p1 != p2) {\r\n\t\t\t$('div.err').text('\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e00\u81f4\u3057\u3066\u3044\u307e\u305b\u3093\u3002');\r\n\t\t} else {\r\n\t\t\t$('div.err').text('');\r\n\t\t}\r\n\t});\r\n})\r\n<\/pre>\n<p><strong>\u30d1\u30b9\u30ef\u30fc\u30c9\u4e0d\u4e00\u81f4<\/strong><br \/>\n\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u4e0d\u4e00\u81f4\u306e\u5834\u5408\u3084\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u304c\u7a7a\u6b04\u306e\u3068\u304d\u306f\u767b\u9332\u30dc\u30bf\u30f3\u3092\u62bc\u305b\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 13; highlight: [20,23,24,25,26]; title: ; notranslate\" title=\"\">\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\n$(function() {\r\n\t$('[type=password]').on('keyup', function() {\r\n\t\tvar p1 = $('[name=password]').val();\r\n\t\tvar p2 = $('[name=password2]').val();\r\n\t\tif (p1 != p2) {\r\n\t\t\t$('div.err').text('\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e00\u81f4\u3057\u3066\u3044\u307e\u305b\u3093\u3002');\r\n\t\t\t$('[type=submit]').attr('disabled', true);\r\n\t\t} else {\r\n\t\t\t$('div.err').text('');\r\n\t\t\tvar name = $('[name=username]').val();\r\n\t\t\tif (name != '') {\r\n\t\t\t\t$('[type=submit]').attr('disabled', false);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n})\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e00\u81f4\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u30e6\u30fc\u30b6\u30fc\u540d\u3092\u5165\u529b\u3057\u3066\u3082\u767b\u9332\u30dc\u30bf\u30f3\u3092\u62bc\u305b\u306a\u3044\u307e\u307e\u306a\u306e\u3067\u3001\u305d\u3053\u3092\u6539\u5584\u3059\u308b\u3002<\/p>\n<p>newuser.html<\/p>\n<pre class=\"brush: xml; first-line: 13; title: ; notranslate\" title=\"\">\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\n$(function() {\r\n\t$('[type=submit]').attr('disabled', true);\r\n\t$('[name=username]').on('keyup', function() {\r\n\t\tcheckFields();\r\n\t});\r\n\t$('[type=password]').on('keyup', function() {\r\n\t\tcheckFields();\r\n\t});\r\n});\r\n\r\nfunction checkFields() {\r\n\tvar name = $('[name=username]').val();\r\n\tif (name.length == 0) {\r\n\t\t$('[type=submit]').attr('disabled', true);\r\n\t\t$('div.err').text('\u30e6\u30fc\u30b6\u30fc\u540d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002');\r\n\t\treturn;\r\n\t}\r\n\tvar p1 = $('[name=password]').val();\r\n\tvar p2 = $('[name=password2]').val();\r\n\tif (p1 != p2) {\r\n\t\t$('div.err').text('\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e00\u81f4\u3057\u3066\u3044\u307e\u305b\u3093\u3002');\r\n\t\t$('[type=submit]').attr('disabled', true);\r\n\t\treturn;\r\n\t}\r\n\t$('div.err').text('');\r\n\t$('[type=submit]').attr('disabled', false);\r\n}\r\n&lt;\/script&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>\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3 \u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u78ba\u8a8d\u306e\u305f\u3081\u306b\u4e8c\u56de\u5165\u529b\u3055\u305b\u308b\u3002 \u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3067\u3001\u767b\u9332\u3067\u304d\u306a\u3044\u3068\u304d\u306f\u30a8\u30e9\u30fc\u3092\u8868\u793a\u3059\u308b\u3002 \u3059\u3067\u306b\u767b\u9332\u6e08\u307f\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u306e\u5834\u5408 \u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e0d\u4e00\u81f4\u306e\u5834\u5408 \u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u4e0d\u4e00 &hellip; <a href=\"https:\/\/2019se3.satoshis.jp\/?p=312\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;9\u67085\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":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/312"}],"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=312"}],"version-history":[{"count":12,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/312\/revisions"}],"predecessor-version":[{"id":324,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/312\/revisions\/324"}],"wp:attachment":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}