{"id":345,"date":"2005-04-04T04:00:00","date_gmt":"2005-04-03T19:00:00","guid":{"rendered":"https:\/\/ecoop.net\/memo\/2005-04-04-4.html"},"modified":"2017-03-16T15:17:23","modified_gmt":"2017-03-16T06:17:23","slug":"2005-04-04-4","status":"publish","type":"post","link":"https:\/\/www.ecoop.net\/memo\/archives\/2005-04-04-4.html","title":{"rendered":"Servlet \u306e\u57fa\u672c"},"content":{"rendered":"<p>\n&#8211; \u57fa\u672c\u306f\u901a\u5e38\u306e\u30af\u30e9\u30b9\u3068\u540c\u3058\u3060\u304c\u3001\u6761\u4ef6\u3068\u3057\u3066 javax.servlet.http.HttpServlet\u3092\u89aa\u30af\u30e9\u30b9\u3068\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<br \/>\n&#8211; protected void do*(HttpServletRequest, HttpServletResponse)<br \/>\ndoGet, doPost, doDelete, doHead, doOptions, doPut, doTrace \u304c\u3042\u308a\u3001\u305d\u308c\u305e\u308c\u5bfe\u5fdc\u3059\u308b\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u3068\u304d\u306b\u547c\u3073\u51fa\u3055\u308c\u308b\u3002<br \/>\n&#8211; protected void service(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException<br \/>\n\u5225\u306e\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3055\u308c\u305f service \u30e1\u30bd\u30c3\u30c9\u304b\u3089\u51e6\u7406\u3092\u53d7\u3051\u3001\u914d\u5206\u3059\u308b\u306e\u304c\u5f79\u76ee\u306a\u306e\u3067 protected\u3002<br \/>\nparent.service(req,res) \u3092\u547c\u3073\u51fa\u3057\u305f\u6642\u70b9\u3067 do*(req,res) \u306e\u51e6\u7406\u304c\u884c\u308f\u308c\u308b\u306e\u3067\u3001\u305d\u306e\u524d\u5f8c\u306e\u5171\u901a\u52d5\u4f5c\u3092\u5b9a\u7fa9\u3059\u308b\u306e\u306b\u4fbf\u5229\u3002<br \/>\n&#8211; \u65e5\u672c\u8a9e(\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57)\u3092\u5f15\u6570\u306b\u3068\u308b<br \/>\n&#8212; getParametervalues,getParameter\u3092\u4f7f\u3044\u3001\u5316\u3051\u305f\u72b6\u614b\u306e\u6587\u5b57\u3092\u53d6\u5f97\u3057\u305f\u3042\u3068<\/p>\n<blockquote><p>new String(string.getBytes(&#8220;ISO_8859_1&#8221;), &#8220;Shift_JIS&#8221;);\n<\/p><\/blockquote>\n<p>\u306e\u3088\u3046\u306b\u3059\u308b\u3002(HTTP\u30d7\u30ed\u30c8\u30b3\u30eb\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u304c ISO-8859-1 \u306e\u305f\u3081)<br \/>\n&#8212; HttpServletRequest\u30af\u30e9\u30b9\u306esetCharacterEncoding\u3067\u3001\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u524d\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u3066\u304a\u304f\u3002<br \/>\n&#8212; HttpServletRequest#setCharacterEncoding(String enc) \u306e\u6319\u52d5\u306e\u9055\u3044\u306e\u554f\u984c\u306b\u6ce8\u610f\uff01<br \/>\nTomcat 4.1.29 \u4ee5\u964d\u306e 4.1.*\/5.0.16\u4ee5\u964d\u306e 5.0.*\u3001\u3067\u306f\u3001Get\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u306a\u304f\u306a\u3063\u305f\u3002GET\u306e\u5f15\u6570\u306fURI\u306b\u542b\u307e\u308c\u308b\u306e\u3067\u3001URI\u306f\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u308b\u3079\u304d\u3067\u306f\u306a\u3044\u3068\u3044\u3046\u898b\u89e3\u306b\u3088\u308b\u4ed5\u69d8\u5909\u66f4\u3068\u306e\u3053\u3068\u3002<br \/>\n&#8211; \u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u3068\u3044\u3046\u3053\u3068\u3002<br \/>\n\u30b5\u30fc\u30d0\u30b5\u30a4\u30c9\u3067\u306f\uff11\u3064\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f7f\u3044\u307e\u308f\u3057\u3066\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u3067\u52d5\u4f5c\u3059\u308b\u306e\u3067\u3001\u30b9\u30ec\u30c3\u30c9\u540c\u58eb\u306e\u4e0d\u8981\u306a\u5e72\u6e09\u3092\u306a\u304f\u3055\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<br \/>\n&#8220;static\u3067\u306f\u306a\u3044&#8221;\u30d5\u30a3\u30fc\u30eb\u30c9(\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570)\u3082\u30b9\u30ec\u30c3\u30c9\u9593\u3067\u306f\u5171\u6709\u3055\u308c\u3066\u3044\u308b\u4e8b\u306b\u6ce8\u610f\uff01<br \/>\n&#8211;> \u30da\u30fc\u30b8\u95b2\u89a7\u8005\u56fa\u6709\u306e\u5909\u6570\u3092\u6301\u3061\u305f\u3044\u5834\u5408\u3001\u30e1\u30bd\u30c3\u30c9\u5185\u3067\u5b9a\u7fa9\u3057\u305f\u5909\u6570\u3092\u4f7f\u308f\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<br \/>\n\u30c7\u30fc\u30bf\u30a2\u30af\u30bb\u30b9\u306a\u3069\u540c\u671f\u3092\u53d6\u3089\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u5834\u5408\u306f\u3001(\u30c7\u30c3\u30c9\u30ed\u30c3\u30af\u306b\u304f\u308c\u3050\u308c\u3082\u6ce8\u610f\u3057\u3064\u3064)\u9069\u5b9c synchronized \u306b\u3059\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8211; \u57fa\u672c\u306f\u901a\u5e38\u306e\u30af\u30e9\u30b9\u3068\u540c\u3058\u3060\u304c\u3001\u6761\u4ef6\u3068\u3057\u3066 javax.servlet.http.HttpServlet\u3092\u89aa\u30af\u30e9\u30b9\u3068\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002 &#8211; protected void do*(HttpServl &hellip; <a href=\"https:\/\/www.ecoop.net\/memo\/archives\/2005-04-04-4.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">Servlet \u306e\u57fa\u672c<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[141],"tags":[42],"class_list":["post-345","post","type-post","status-publish","format-standard","hentry","category-lifehack","tag-java"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/comments?post=345"}],"version-history":[{"count":0,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/345\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media?parent=345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/categories?post=345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/tags?post=345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}