{"id":257,"date":"2014-07-24T05:34:12","date_gmt":"2014-07-24T14:34:12","guid":{"rendered":"http:\/\/blog.box.kr\/?p=257"},"modified":"2014-07-24T05:34:12","modified_gmt":"2014-07-24T14:34:12","slug":"jquery-ajax-%ed%86%b5%ec%8b%a0%ea%b3%bc-spring-%ec%9d%b8%ec%88%98-%ec%b2%98%eb%a6%ac-%eb%b0%a9%eb%b2%95","status":"publish","type":"post","link":"https:\/\/blog.box.kr\/?p=257","title":{"rendered":"JQuery Ajax \ud1b5\uc2e0\uacfc Spring \uc778\uc218 \ucc98\ub9ac \ubc29\ubc95"},"content":{"rendered":"<p>JQuery\uc758 Ajax\ud1b5\uc2e0\uc744 \ud558\uba74 \ud558\uae30\uc640 \uac19\uc774 \ubcf4\ub0b8\ub2e4.<\/p>\n<pre class=\"lang-java prettyprint prettyprinted\" style=\"color: #000000;\"><code><span class=\"pln\"> $<\/span><span class=\"pun\">.<\/span><span class=\"pln\">ajax<\/span><span class=\"pun\">({<\/span><span class=\"pln\">\n            type<\/span><span class=\"pun\">:<\/span><span class=\"str\" style=\"color: #800000;\">\"POST\"<\/span><span class=\"pun\">,<\/span><span class=\"pln\">\n            url<\/span><span class=\"pun\">:<\/span><span class=\"str\" style=\"color: #800000;\">'http:\/\/localhost:8180\/GisProject\/MainService'<\/span><span class=\"pun\">,<\/span><span class=\"pln\">\n            data<\/span><span class=\"pun\">:{<\/span><span class=\"pln\">mydata<\/span><span class=\"pun\">:<\/span><span class=\"pln\">JSON<\/span><span class=\"pun\">.<\/span><span class=\"pln\">stringify<\/span><span class=\"pun\">(<\/span><span class=\"pln\">params<\/span><span class=\"pun\">)},<\/span><span class=\"pln\">\n            datatype<\/span><span class=\"pun\">:<\/span><span class=\"str\" style=\"color: #800000;\">\"json\"<\/span><span class=\"pun\">,<\/span><span class=\"pln\">\n            success<\/span><span class=\"pun\">:<\/span><span class=\"pln\">function<\/span><span class=\"pun\">(<\/span><span class=\"pln\">msg<\/span><span class=\"pun\">)<\/span><span class=\"pun\">{<\/span><span class=\"pln\">\n               console<\/span><span class=\"pun\">.<\/span><span class=\"pln\">log<\/span><span class=\"pun\">(<\/span><span class=\"pln\">msg<\/span><span class=\"pun\">);<\/span><span class=\"pun\">},<\/span><span class=\"pln\">\n            error<\/span><span class=\"pun\">:<\/span><span class=\"pln\">function<\/span><span class=\"pun\">(<\/span><span class=\"pln\">xhr<\/span><span class=\"pun\">,<\/span><span class=\"pln\">status<\/span><span class=\"pun\">)<\/span><span class=\"pun\">{<\/span><span class=\"pln\">\n                 console<\/span><span class=\"pun\">.<\/span><span class=\"pln\">log<\/span><span class=\"pun\">(<\/span><span class=\"pln\">status<\/span><span class=\"pun\">);<\/span><span class=\"pun\">},<\/span><span class=\"pun\">});<\/span><\/code><\/pre>\n<p>\uc774 \uacbd\uc6b0 \u00a0Spring \uc758 \uae30\ubcf8 Parameter\ub85c\ub294 \ubc1b\uc744 \ubc29\ubc95\uc774 \uc5c6\ub2e4.. \uc65c \ub0d0\uba74. Requert.payload \ud615\uc2dd\uc73c\ub85c \ub118\uc5b4 \uac00\uae30 \ub54c\ubb38\uc5d0..<\/p>\n<p>&nbsp;<\/p>\n<p>\uc774\ub97c \ubc1b\uae30 \uc704\ud574\uc120 \ud558\uae30\uc640 \uac19\uc740 \ucc98\ub9ac\uac00 \ud544\uc694 \ud558\ub2e4..<\/p>\n<p>\/\/ Request playload Data \uac00\uc838\uc624\uae30.<br \/>\nBufferedReader bfr= <span style=\"color: #ff0000;\"><strong>req.getReader(); \u00a0\/\/ getReader\ub97c \ud1b5\ud574\uc11c \uc77d\uc5b4 \uc62c \uc218 \uc788\ub2e4.<\/strong><\/span><br \/>\nStringBuffer sbPayLoad = new StringBuffer();<br \/>\nString sCurrentLine;<br \/>\nwhile (( sCurrentLine = bfr.readLine()) != null) {<br \/>\nsbPayLoad.append( sCurrentLine );<br \/>\n}<\/p>\n<p>\uc77d\uc5b4\uc628 \uac1d\uccb4 ( \ub300\ubd80\ubd84 JSON ) \uc740 \ud558\uae30\uc640 \uac19\uc774 \ud30c\uc2f1\ud574\uc11c \uc0ac\uc6a9\ud55c\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>\/\/ json parsering<br \/>\nJSONObject jsonObjectMain = JSONObject.fromObject( sbPayLoad.toString() );<br \/>\nString page = jsonObjectMain.getString( &#8220;page&#8221; );<br \/>\nString code = jsonObjectMain.getString( &#8220;code&#8221; );<br \/>\nJSONObject jsonObjectReq =jsonObjectMain.getJSONObject(&#8220;requestData&#8221;);<\/p>\n<p>String lo_code = jsonObjectReq.getString( &#8220;lo_code&#8221; );<br \/>\nString sector = jsonObjectReq.getString( &#8220;sector&#8221; );<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\uc774\uac83 \ub54c\ubb38\uc5d0 2\uc2dc\uac04 \ub118\uac1c \ud5e4\ub9f8\ub2e4. \u3160\u3160<\/p>\n<p>\uc774\uc0c1.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JQuery\uc758 Ajax\ud1b5\uc2e0\uc744 \ud558\uba74 \ud558\uae30\uc640 \uac19\uc774 \ubcf4\ub0b8\ub2e4. $.ajax({ type:&#8221;POST&#8221;, url:&#8217;http:\/\/localhost:8180\/GisProject\/MainService&#8217;, data:{mydata:JSON.stringify(params)}, datatype:&#8221;json&#8221;, success:function(msg){ console.log(msg);}, error:function(xhr,status){ console.log(status);},}); \uc774 \uacbd\uc6b0 \u00a0Spring \uc758 \uae30\ubcf8 Parameter\ub85c\ub294 \ubc1b\uc744 \ubc29\ubc95\uc774 \uc5c6\ub2e4.. \uc65c \ub0d0\uba74. Requert.payload \ud615\uc2dd\uc73c\ub85c \ub118\uc5b4 \uac00\uae30 \ub54c\ubb38\uc5d0.. &nbsp; \uc774\ub97c \ubc1b\uae30 \uc704\ud574\uc120 \ud558\uae30\uc640 \uac19\uc740 \ucc98\ub9ac\uac00 \ud544\uc694 \ud558\ub2e4.. \/\/ Request playload Data \uac00\uc838\uc624\uae30. BufferedReader bfr= req.getReader(); \u00a0\/\/ getReader\ub97c \ud1b5\ud574\uc11c \uc77d\uc5b4 \uc62c \uc218 \uc788\ub2e4. StringBuffer sbPayLoad = new StringBuffer(); String sCurrentLine; while (( sCurrentLine = bfr.readLine()) != null) { sbPayLoad.append( sCurrentLine ); } \uc77d\uc5b4\uc628 \uac1d\uccb4 ( \ub300\ubd80\ubd84 JSON ) \uc740 \ud558\uae30\uc640 \uac19\uc774 \ud30c\uc2f1\ud574\uc11c \uc0ac\uc6a9\ud55c\ub2e4. &nbsp; \/\/ json parsering JSONObject jsonObjectMain = JSONObject.fromObject( sbPayLoad.toString() ); String page = jsonObjectMain.getString( &#8220;page&#8221; ); String code = jsonObjectMain.getString( &#8220;code&#8221; ); JSONObject jsonObjectReq =jsonObjectMain.getJSONObject(&#8220;requestData&#8221;); String lo_code = jsonObjectReq.getString( &#8220;lo_code&#8221; ); String sector = jsonObjectReq.getString( &#8220;sector&#8221; ); &nbsp; &nbsp; \uc774\uac83 \ub54c\ubb38\uc5d0 2\uc2dc\uac04 \ub118\uac1c \ud5e4\ub9f8\ub2e4. \u3160\u3160 \uc774\uc0c1.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"ngg_post_thumbnail":0,"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[15,16,29],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5q9Zn-49","jetpack-related-posts":[{"id":844,"url":"https:\/\/blog.box.kr\/?p=844","url_meta":{"origin":257,"position":0},"title":"[link] AngularJS file upload DEMO","date":"2015-05-20","format":false,"excerpt":"https:\/\/blueimp.github.io\/jQuery-File-Upload\/angularjs.html","rel":"","context":"In &quot;\uae30\uc220&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":574,"url":"https:\/\/blog.box.kr\/?p=574","url_meta":{"origin":257,"position":1},"title":"JUI : \uc81c\ub2c8\ud37c \uc18c\ud504\ud2b8\uc758 UI \ub77c\uc774\ube0c\ub7ec\ub9ac..","date":"2015-01-27","format":false,"excerpt":"\uc81c\ub2c8\ud37c \uc18c\ud504\ud2b8\uc5d0\uc11c HTML5 \ud615\uc2dd\uc758 JENNIFER5\ub97c \ub9cc\ub4e4 \ub54c \uac1c\ubc1c\ud55c UI \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c GITHUB\uc5d0 \uacf5\uac1c \ud568. \ubcf4\uc544\ud558\ub2c8 \uc694\uc998 \uc720\ud589\ud558\ub294 \ub9ce\uc740 \uac1c\ub150\uacfc \uc131\ub2a5 \uc774\uc288\uc5d0 \ub530\ub978 \uc870\uce58 \uc0ac\ud56d\uc774 \uc0c1\ub2f9\ud788 \ucd94\uac00\ub41c\uac70 \uac19\ub124... \u00a0 BOOTSTRIP\uacfc JQUERY \ub4f1\uacfc \uac19\uc774 \uc36a\uc5b4 \uc4f0\uba74 \uc88b\uc740 \uacb0\uacfc\ub97c \uc5bb\uc744 \ub4ef.. \uc81c\ub2c8\ud37c UI \ucef4\ud3ec\ub10c\ud2b8(JUI) \uacf5\uc2dd\ud648\ud398\uc774\uc9c0 \uc8fc\uc18c \uc81c\ub2c8\ud37c UI \ucef4\ud3ec\ub10c\ud2b8(JUI) \uae43\ud5c8\ube0c \ud398\uc774\uc9c0","rel":"","context":"In &quot;\uae30\uc220&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":362,"url":"https:\/\/blog.box.kr\/?p=362","url_meta":{"origin":257,"position":2},"title":"[\ud38c]Trello \uc544\ud0a4\ud14d\ucc98","date":"2014-09-15","format":false,"excerpt":"Trello \uc544\ud0a4\ud14d\ucc98 CoffeeScript Trello\uc758 \ud074\ub77c\uc774\uc5b8\ud2b8\uc640 \uc11c\ubc84 \ubaa8\ub450 \uc21c\uc218 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \ud504\ub85c\uc81d\ud2b8\ub85c \uc2dc\uc791\ub418\uc5c8\uace0, 2011\ub144 5\uc6d4\uae4c\uc9c0\ub294 \uc801\uc5b4\ub3c4 \uadf8\ub807\uac8c \uc720\uc9c0\ub418\uc5c8\ub294\ub370 \uadf8 \uc774\ud6c4\ubd80\ud130 CoffeeScript\ub97c \uc5bc\ub9c8\ub098 \uc88b\uc544\ud558\ub294\uc9c0 \ubcf4\uae30 \uc704\ud574\uc11c CoffeeScript\ub85c \uc774\uc911\uc73c\ub85c \uac1c\ubc1c\ud574 \ud3ec\ud305\ud558\uae30 \uc2dc\uc791\ud588\ub2e4. \uadf8 \ud6c4 \uc6b0\ub9ac\ub294 CoffeeScript\ub97c \uc0ac\ub791\ud568\uc744 \ud655\uc778\ud588\uace0 \uace7, \ub098\uba38\uc9c0 \ubaa8\ub450\uc758 \ucf54\ub4dc\ub3c4 CoffeeScript\ub85c \uc804\ud658\uc744 \uc644\ub8cc\ud588\ub2e4.\u00a0 CoffeeScript\ub294 JavaScript\ub97c \uc77d\uc744 \uc218 \uc788\ub294 \ucef4\ud30c\uc77c \uc5b8\uc5b4\uc774\ub2e4. \uc6b0\ub9ac\uac00 \uc2dc\uc791\ud588\uc744\u2026","rel":"","context":"In &quot;\ucc38\uace0\ub97c \uc704\ud55c \uc800\uc7a5\ubb3c&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":855,"url":"https:\/\/blog.box.kr\/?p=855","url_meta":{"origin":257,"position":3},"title":"[scrap][AngularJS] AngularJS \uc640 RequireJS \ub97c \ud65c\uc6a9\ud55c \ub300\uaddc\ubaa8 \uc6f9 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c","date":"2015-05-20","format":false,"excerpt":"http:\/\/programmingsummaries.tistory.com\/m\/post\/229 \u00a0 AngularJS \uae30\ubc18 \uc6f9 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158, \uc5b4\ub514\uc11c\ubd80\ud130 \uc2dc\uc791\ud574\uc57c \ud560\uae4c? AngularJS\ub97c \uae30\ubc18\uc73c\ub85c \uc6f9 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud560 \ub54c, AngularJS \uc0ac\uc774\ud2b8\uc5d0\uc11c \uc81c\uacf5\ud574\uc8fc\ub294 \ubb38\uc11c\ub4e4\uc740 \ud2b9\uc815 API \ud65c\uc6a9 \ubc29\ubc95\uc744 \uc774\ud574\ud558\uac70\ub098 \ub2e8\uc21c\ud55c \uc218\uc900\uc73c\ub85c \uc2dc\uc791\ud558\uae30\uc5d0\ub294 \uc801\ud569\ud558\uc9c0\ub9cc \uc5b4\ub5bb\uac8c \uc218\ubc31\uc5d0\uc11c \uc218\ucc9c\uc904\uc5d0 \uc774\ub974\ub294 \ucf54\ub4dc\ub85c \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uad6c\uc131\ud558\uace0 \ubc1c\uc804\uc2dc\ucf1c\uc57c\ud558\ub294\uc9c0\uc5d0 \ub300\ud574\uc11c\ub294 \uba85\ud655\ud55c \uac00\uc774\ub4dc\ub77c\uc778\uc744 \uc81c\uacf5\ud574\uc8fc\uace0 \uc788\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. AngularJS\ub97c \uae30\ubc18\uc73c\ub85c \uc218\ucc28\ub840\uc758 \ud06c\uace0 \uc791\uc740 \uac1c\ubc1c\uc744 \uc9c4\ud589\ud558\uba70 \uc5bb\uc740\u2026","rel":"","context":"In &quot;\uae30\uc220&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1143,"url":"https:\/\/blog.box.kr\/?p=1143","url_meta":{"origin":257,"position":4},"title":"JQuery\ub85c Checkbox check\uc5ec\ubd80 \ud655\uc778 \ubc0f Label \ud65c\uc6a9 \ubc29\ubc95.","date":"2016-07-28","format":false,"excerpt":"Label\ub85c \ubb36\uc5b4 \uc8fc\uba74 check button\uc774 \uc544\ub2c8\ub77c \uae00\uc790\ub97c \ub20c\ub7ec\ub3c4\u00a0check button \ub204\ub974\ub294 \uac83 \ucc98\ub7fc \ub41c\ub2e4. \u00a0 \u00a0 \u00a0 \u00a0<label><input type='checkbox' id='check_all' class='input_check' \/> <b>Check me<\/b><\/label> Checked \ud655\uc778 if ( true == \u00a0$(\"#check_all\").is(\":checked\") ) { alert ( \"checked\" ); } else { alert( \" un checked\"); } Check\/ uncheck \ucc98\ub9ac $(\"#check_all\").prop(\"checked\", true );\u2026","rel":"","context":"In &quot;JAVA&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1139,"url":"https:\/\/blog.box.kr\/?p=1139","url_meta":{"origin":257,"position":5},"title":"JQuery with Bootstrap","date":"2016-07-27","format":false,"excerpt":"http:\/\/maczniak.github.io\/bootstrap\/javascript.html \u00a0 and \u00a0 Collapse navigator \u00a0 http:\/\/zetawiki.com\/wiki\/%EB%B6%80%ED%8A%B8%EC%8A%A4%ED%8A%B8%EB%9E%A9_%EB%82%B4%EB%B9%84%EA%B2%8C%EC%9D%B4%EC%85%98%EB%B0%94_%EC%9E%90%EB%8F%99%EC%A0%91%EA%B8%B0_navbar-collapse \u00a0 \ubaa9\ucc28 1 \uac1c\uc694 2 \uc608\uc2dc 3 \uac19\uc774 \ubcf4\uae30 4 \ucc38\uace0 \uc790\ub8cc \uac1c\uc694[\ud3b8\uc9d1] Collapsing The Navigation Bar, navbar-collapse \ubd80\ud2b8\uc2a4\ud2b8\ub7a9 \ub124\ube44\uac8c\uc774\uc158\ubc14 \uc790\ub3d9\uc811\uae30 \uc608\uc2dc[\ud3b8\uc9d1] \ud654\uba74\ub108\ube44\uac00 \ub113\uc73c\uba74 navbar-collapse\uc774 \ud45c\uc2dc\ub418\uace0, navbar-toggle\uc740 \uc228\uaca8\uc9d0 \ud654\uba74\ub108\ube44\uac00 \uc791\uc73c\uba74 navbar-collapse\uc740 \uc228\uaca8\uc9c0\uace0, navbar-toggle\uc740 \ud45c\uc2dc\ub428 \ub300\uc2e0 \ubc84\ud2bc\uc744 \ub204\ub974\uba74 \uc138\ub85c \ub4dc\ub86d\ub2e4\uc6b4 \ud615\uc2dd\uc73c\ub85c \ub098\ud0c0\ub0a8 http:\/\/zetawiki.com\/ex\/bootstrap\/navbar-collapse.html\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/257"}],"collection":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=257"}],"version-history":[{"count":0,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/257\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}