{"id":1027,"date":"2018-04-15T17:16:22","date_gmt":"2018-04-15T08:16:22","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=1027"},"modified":"2023-05-27T20:46:04","modified_gmt":"2023-05-27T11:46:04","slug":"%e3%80%90%e3%82%b5%e3%83%bc%e3%83%96%e3%83%ac%e3%83%83%e3%83%88%e3%80%91%e3%82%b5%e3%83%bc%e3%83%96%e3%83%ac%e3%83%83%e3%83%88%e3%83%95%e3%82%a3%e3%83%ab%e3%82%bf%e3%83%bc%e3%81%ae%e5%88%9d%e6%9c%9f","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=1027","title":{"rendered":"\u3010\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u3011\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30d5\u30a3\u30eb\u30bf\u30fc\u306e\u521d\u671f\u5316\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30d5\u30a3\u30eb\u30bf\u306b\u3064\u3044\u3066\u306f\u3001\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3055\u305b\u3066\u9802\u304d\u307e\u3057\u305f\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"cEnInQTYMo\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=999\">\u3010\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u3011\u5171\u901a\u51e6\u7406\u3092\u66f8\u304f\u306b\u306f\uff1f\uff08\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30d5\u30a3\u30eb\u30bf\u306e\u5229\u7528\uff09<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=999&#038;embed=true#?secret=cEnInQTYMo\" data-secret=\"cEnInQTYMo\" width=\"500\" height=\"282\" title=\"&#8220;\u3010\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u3011\u5171\u901a\u51e6\u7406\u3092\u66f8\u304f\u306b\u306f\uff1f\uff08\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30d5\u30a3\u30eb\u30bf\u306e\u5229\u7528\uff09&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u3055\u3089\u306b\u8ffd\u52a0\u306e\u6a5f\u80fd\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30d5\u30a3\u30eb\u30bf\u306b\u306f\u3001web.xml\u306b\u5024\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3067\u3001\u521d\u671f\u5316\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;web-app xmlns=&quot;http:\/\/java.sun.com\/xml\/ns\/javaee&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http:\/\/java.sun.com\/xml\/ns\/javaee http:\/\/java.sun.com\/xml\/ns\/javaee\/web-app_2_5.xsd&quot; version=&quot;2.5&quot;&gt;\r\n\t&lt;filter&gt;\r\n\t\t&lt;filter-name&gt;SampleFilter&lt;\/filter-name&gt;\r\n\t\t&lt;filter-class&gt;filter.FilterTest&lt;\/filter-class&gt;\r\n\t\t&lt;init-param&gt;\r\n\t\t\t&lt;param-name&gt;encode&lt;\/param-name&gt;\r\n\t\t\t&lt;param-value&gt;UTF-8&lt;\/param-value&gt;\r\n\t\t&lt;\/init-param&gt;\r\n\t&lt;\/filter&gt;\r\n&lt;\/web-app&gt;\r\n<\/pre>\n<p>web.xml\u306e&lt;filter&gt;\u30bf\u30b0\u306f\u3001\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30bf\u30b0\u3067\u3057\u305f\u304c\u3001\u305d\u3053\u306b\u300c&lt;init-param&gt;\u300d\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30d5\u30a3\u30eb\u30bf\u306e\u4e2d\u3067\u3001\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u5909\u6570\u3068\u3057\u3066\u5b9a\u7fa9\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u6d3b\u7528\u3059\u308b\u306b\u306f\u3001init\u30e1\u30bd\u30c3\u30c9\u306e\u4e2d\u3067\u3001filterConfig\u30af\u30e9\u30b9\u306egetInitParameter\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u3001\u5024\u3092\u53d6\u308a\u51fa\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a3\u30eb\u30bf\u30fc\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u7b49\u306b\u683c\u7d0d\u3057\u3066\u3001doFilter\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage filter;\r\n\r\nimport java.io.IOException;\r\n\r\nimport javax.servlet.Filter;\r\nimport javax.servlet.FilterChain;\r\nimport javax.servlet.FilterConfig;\r\nimport javax.servlet.ServletException;\r\nimport javax.servlet.ServletRequest;\r\nimport javax.servlet.ServletResponse;\r\n\r\npublic class FilterTest implements Filter{\r\n\r\n    private String encode;\r\n\r\n    public void init(FilterConfig filterConfig)\r\n    throws ServletException {\r\n        encode = filterConfig.getInitParameter(&quot;encode&quot;);\r\n\t}\r\n\r\n\tpublic void doFilter(ServletRequest request,\r\n\t    ServletResponse response, FilterChain chain)\r\n\t    throws IOException, ServletException {\r\n\r\n        request.setCharacterEncoding(encode);\r\n\t\tchain.doFilter(request, response);\r\n\r\n\t}\r\n\r\n\tpublic void destroy() {\r\n\t\t\/\/\u4f55\u3082\u3057\u306a\u3044\u3002\r\n\t}\r\n\r\n}\r\n<\/pre>\n<h2>\u521d\u671f\u5316\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u30e1\u30ea\u30c3\u30c8<\/h2>\n<p><strong>\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u306a\u304f\u3001web.xml\u306e\u5024\u306e\u66f8\u304d\u63db\u3048\u306e\u307f<\/strong>\u3067\u3001\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u70b9\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30d5\u30a3\u30eb\u30bf\u306b\u3064\u3044\u3066\u306f\u3001\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3055\u305b\u3066\u9802\u304d\u307e\u3057\u305f\u3002 \u3010\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u3011\u5171\u901a\u51e6\u7406\u3092\u66f8\u304f\u306b\u306f\uff1f\uff08\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30d5\u30a3\u30eb\u30bf\u306e\u5229\u7528\uff09 \u3055\u3089\u306b\u8ffd\u52a0\u306e\u6a5f\u80fd\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30d5\u30a3\u30eb\u30bf\u306b\u306f\u3001web.xml\u306b\u5024\u3092\u5b9a\u7fa9\u3059\u308b [&hellip;]","protected":false},"author":1,"featured_media":1093,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/1027"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1027"}],"version-history":[{"count":6,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/1027\/revisions"}],"predecessor-version":[{"id":20259,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/1027\/revisions\/20259"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/1093"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1027"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}