锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产亚洲人成A在线V网站,亚洲成AV人片在WWW色猫咪,亚洲免费在线观看视频http://www.tkk7.com/jlin/category/54582.htmlzh-cnThu, 13 Dec 2018 20:57:37 GMTThu, 13 Dec 2018 20:57:37 GMT60璁板綍涓嬈afka-manager1.3.3.18 Consumers is not display with kafka2.1.0 versionhttp://www.tkk7.com/jlin/archive/2018/12/13/433545.htmlflyflyThu, 13 Dec 2018 07:36:00 GMThttp://www.tkk7.com/jlin/archive/2018/12/13/433545.htmlhttp://www.tkk7.com/jlin/comments/433545.htmlhttp://www.tkk7.com/jlin/archive/2018/12/13/433545.html#Feedback0http://www.tkk7.com/jlin/comments/commentRss/433545.htmlhttp://www.tkk7.com/jlin/services/trackbacks/433545.html闃呰鍏ㄦ枃

fly 2018-12-13 15:36 鍙戣〃璇勮
]]>
@RequestParam涓嶡PathVariable鐨勫尯鍒紙杞級http://www.tkk7.com/jlin/archive/2018/08/22/433344.htmlflyflyWed, 22 Aug 2018 03:05:00 GMThttp://www.tkk7.com/jlin/archive/2018/08/22/433344.htmlhttp://www.tkk7.com/jlin/comments/433344.htmlhttp://www.tkk7.com/jlin/archive/2018/08/22/433344.html#Feedback0http://www.tkk7.com/jlin/comments/commentRss/433344.htmlhttp://www.tkk7.com/jlin/services/trackbacks/433344.html鍦?a title="Java EE鐭ヨ瘑搴? target="_blank" style="margin: 0px; padding: 0px; color: #000000;">spring MVC涓紝涓よ呯殑浣滅敤閮芥槸灝唕equest閲岀殑鍙傛暟鐨勫肩粦瀹氬埌contorl閲岀殑鏂規(guī)硶鍙傛暟閲岀殑錛屽尯鍒湪浜庯紝URL鍐欐硶涓嶅悓銆?/p>

浣跨敤@RequestParam鏃訛紝URL鏄繖鏍風(fēng)殑錛歨ttp://host:port/path?鍙傛暟鍚?鍙傛暟鍊?br style="margin: 0px; padding: 0px;" />

浣跨敤@PathVariable鏃訛紝URL鏄繖鏍風(fēng)殑錛歨ttp://host:port/path/鍙傛暟鍊?br style="margin: 0px; padding: 0px;" />

渚嬪錛?/p>

 

[java] view plain copy
 
  1. @RequestMapping(value="/user",method = RequestMethod.GET)  
  2.    public @ResponseBody  
  3.    User printUser(@RequestParam(value = "id", required = false, defaultValue = "0")  
  4.    int id) {  
  5.     User user = new User();  
  6.        user = userService.getUserById(id);  
  7.        return user;  
  8.    }  
  9.      
  10.    @RequestMapping(value="/user/{id}",method = RequestMethod.GET)  
  11.    public @ResponseBody  
  12.    User printUser2(@PathVariable int id) {  
  13.        User user = new User();  
  14.        user = userService.getUserById(id);  
  15.        return user;  
  16.    }  


 

 

涓婇潰涓や釜鏂規(guī)硶錛岃闂礬寰勫垎鍒涓嬶細(xì)

 




fly 2018-08-22 11:05 鍙戣〃璇勮
]]>
Spring3涓璲s/css/jpg/gif絳夐潤鎬佽祫婧愭棤娉曟壘鍒幫紙No mapping found for HTTP request with URI錛夐棶棰?/title><link>http://www.tkk7.com/jlin/archive/2018/01/30/433031.html</link><dc:creator>fly</dc:creator><author>fly</author><pubDate>Tue, 30 Jan 2018 08:16:00 GMT</pubDate><guid>http://www.tkk7.com/jlin/archive/2018/01/30/433031.html</guid><wfw:comment>http://www.tkk7.com/jlin/comments/433031.html</wfw:comment><comments>http://www.tkk7.com/jlin/archive/2018/01/30/433031.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/jlin/comments/commentRss/433031.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/jlin/services/trackbacks/433031.html</trackback:ping><description><![CDATA[<p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;">鎴戜滑鍦ㄤ嬌鐢╯pring3鐨勬椂鍊欙紝濡傛灉浣跨敤浜嗘敞瑙g殑璇濓紝鎴戜滑浼?xì)鍙戠帋图屾湁鏃跺欐垜浠晫闈㈢殑js/css/jpg/gif絳夋枃浠朵細(xì)鍑虹幇鎵句笉鍒扮殑鎯呭喌錛岀劧鑰屾鏌ュ紩鐢ㄨ礬寰勶紝鍙戠幇鏃犺鏄粷瀵硅礬寰勮繕鏄浉瀵硅礬寰勶紝閮芥病閿欍傝繖涓嬫垜浠氨綰犵粨浜嗭紝鍒板簳鏄粈涔堥棶棰樺憿錛?/span></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;">妤間富鎴戜篃鏄嫤鎬濊壇涔咃紝涓嶇粡鎰忛棿鐪嬪埌浜嗗悗鍙扮殑鏃ュ織錛屾墠鍙戠幇鏄痵pring鎼炵殑楝箋?/span></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><br style="box-sizing: border-box;" /></span></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;">鎶ラ敊淇℃伅錛?span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #ff0000;"><No mapping found for HTTP request with URI [/sandDemo001/images/1.jpg] in DispatcherServlet with name 'spring'></span></span></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #ff0000;"><br style="box-sizing: border-box;" /></span></span></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #330033;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #ff0000; font-size: 18px;"><strong style="box-sizing: border-box;">瑙e喅鏂規(guī)硶1</strong></span>錛?span style="box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;"><strong style="box-sizing: border-box;">鍦╯pring鐨勯厤緗慨鏀?/strong></span></span><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #330033;">web.xml<span style="box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;"><strong style="box-sizing: border-box;">涓嬪</strong></span>spring<span style="box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;"><strong style="box-sizing: border-box;">鐨?/strong></span>DispatcherServlet<span style="box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;"><strong style="box-sizing: border-box;">璇鋒眰</strong></span>url<span style="box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;"><strong style="box-sizing: border-box;">鏄犲皠鐨勯厤緗紝鍏堟潵鐪嬬湅鍘熼厤緗?/strong></span>錛?/span><br style="box-sizing: border-box;" /></span></span></span></p><div bg_html"="" style="box-sizing: border-box; position: relative; overflow-y: hidden; width: 851.391px; color: #454545;"><div style="box-sizing: border-box; margin: 0px;"><div style="box-sizing: border-box; margin: 0px; border-right: 1px solid #e7e5dc;"><strong style="box-sizing: border-box;">[html]</strong> <a title="view plain" style="box-sizing: border-box; background-image: url("../images/ico_plain.gif"); background-position: left top; background-repeat: no-repeat; padding: 1px; outline: 0px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px;">view plain</a><span data-mod="popu_168" style="box-sizing: border-box; margin: 0px; padding: 0px;"> <a title="copy" style="box-sizing: border-box; background-image: url("../images/ico_copy.gif"); background-position: left top; background-repeat: no-repeat; padding: 1px; outline: 0px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px;">copy</a><div style="box-sizing: border-box; margin: 0px; position: absolute; left: 259px; top: 453px; width: 16px; height: 16px; z-index: 99;"></div></span></div></div><ol start="1" style="box-sizing: border-box; border-right: 1px solid #e7e5dc;"><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">    <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">spring</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">    <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-class</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">org.springframework.web.servlet.DispatcherServlet</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-class</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">    <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">load-on-startup</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">1</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">load-on-startup</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">        <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">spring</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">        <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">/</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li></ol></div><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #330033;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><servlet-mapping></span><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;">鐨?/span><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><url-pattern>/</url-pattern></span></span><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #330033;">鎶婃墍鏈夌殑璇鋒眰閮戒氦緇檚pring鍘誨鐞嗕簡錛岃屾墍鏈塧vailable鐨勮姹倁rl閮芥槸鍦–onstroller閲屼嬌鐢ㄧ被浼粿RequestMapping(value = "/login/{user}", method = RequestMethod.GET)榪欐牱鐨勬敞瑙i厤緗殑錛岃繖鏍風(fēng)殑璇濆js/css/jpg/gif絳夐潤鎬佽祫婧愮殑璁塊棶灝變細(xì)寰椾笉鍒般傛墍浠ワ紝鍦?span style="box-sizing: border-box; margin: 0px; padding: 0px;">web.xml閲屾坊鍔犲涓嬬殑閰嶇疆灝卞彲浠ヨВ鍐寵闂浜嗐?/span></span></span></span><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #330033;"></span></span></span></span></span></span></p><div bg_html"="" style="box-sizing: border-box; position: relative; overflow-y: hidden; width: 851.391px; color: #454545;"><div style="box-sizing: border-box; margin: 0px;"><div style="box-sizing: border-box; margin: 0px; border-right: 1px solid #e7e5dc;"><strong style="box-sizing: border-box;">[html]</strong> <a title="view plain" style="box-sizing: border-box; background-image: url("../images/ico_plain.gif"); background-position: left top; background-repeat: no-repeat; padding: 1px; outline: 0px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px;">view plain</a><span data-mod="popu_168" style="box-sizing: border-box; margin: 0px; padding: 0px;"> <a title="copy" style="box-sizing: border-box; background-image: url("../images/ico_copy.gif"); background-position: left top; background-repeat: no-repeat; padding: 1px; outline: 0px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px;">copy</a><div style="box-sizing: border-box; margin: 0px; position: absolute; left: 259px; top: 754px; width: 16px; height: 16px; z-index: 99;"></div></span></div></div><ol start="1" style="box-sizing: border-box; border-right: 1px solid #e7e5dc;"><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">default</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">*.css</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">   </span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">    <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">default</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">    <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">*.gif</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">  </span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">      </span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">default</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">*.jpg</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">      </span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">default</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">*.js</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li></ol></div><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"></p><p style="box-sizing: border-box; margin: 10px 0px; padding: 0px; color: #454545; background-color: #ffffff; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;"><strong style="box-sizing: border-box;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-weight: 400; font-family: Arial; color: #ff0000; font-size: 18px;">瑙e喅鏂規(guī)硶2錛?span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #000000; font-size: 14px;">鍦╯pring鐨勯厤緗枃浠朵腑娣誨姞濡備笅涓琛岋細(xì)</span></span></strong></strong></p><p style="box-sizing: border-box; margin: 10px 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><strong style="box-sizing: border-box;"></strong><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #660000; font-size: 14px;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-weight: 400; color: #006699;"><mvc:default-servlet-handler/></span></strong></span></p><p style="box-sizing: border-box; margin: 10px 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #660000; font-size: 14px;">娉ㄦ剰錛岄渶瑕佹槸spring3.0.5浠ヤ笂鐗堟湰</span></p><br style="box-sizing: border-box; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;" /><span style="box-sizing: border-box; margin: 0px; padding: 0px; background-color: #ffffff; color: #ff0000; font-family: Arial; font-size: 18px;"><strong style="box-sizing: border-box;">瑙e喅鏂規(guī)硶3錛?/strong></span><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; background-color: #ffffff; font-family: Arial;"><strong style="box-sizing: border-box;">鍦╯pring鐨勯厤緗枃浠朵腑娣誨姞濡備笅涓琛岋細(xì)</strong></span><br style="box-sizing: border-box; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;" /><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial; color: #330033;"></span></p><div style="box-sizing: border-box; margin: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff; overflow: hidden;"><!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory --><br style="box-sizing: border-box;" /> <br style="box-sizing: border-box;" /> <mvc:resources mapping="/resources/**" location="/resources/" /> <br style="box-sizing: border-box;" />  <br style="box-sizing: border-box;" />榪欎釜閰嶇疆鍛婅瘔spring 闈欐佽祫婧愮殑澶勭悊鏂瑰紡<br /><br />杞細(xì) <span style="font-family: verdana, "courier new"; font-size: 14px;">http://blog.csdn.net/miss_kun/article/details/52047381</span></div><div></div><img src ="http://www.tkk7.com/jlin/aggbug/433031.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/jlin/" target="_blank">fly</a> 2018-01-30 16:16 <a href="http://www.tkk7.com/jlin/archive/2018/01/30/433031.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>涓鑷存ash綆楁硶(JAVA)-杞?/title><link>http://www.tkk7.com/jlin/archive/2017/09/26/432831.html</link><dc:creator>fly</dc:creator><author>fly</author><pubDate>Mon, 25 Sep 2017 16:20:00 GMT</pubDate><guid>http://www.tkk7.com/jlin/archive/2017/09/26/432831.html</guid><wfw:comment>http://www.tkk7.com/jlin/comments/432831.html</wfw:comment><comments>http://www.tkk7.com/jlin/archive/2017/09/26/432831.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/jlin/comments/commentRss/432831.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/jlin/services/trackbacks/432831.html</trackback:ping><description><![CDATA[<div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->Java浠g爜 <br /><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">class</span> ConsistentHash<T> {  <br />  <br />       <span style="color: #0000FF; ">private</span> <span style="color: #0000FF; ">final</span> HashFunction hashFunction;  <br />       <span style="color: #0000FF; ">private</span> <span style="color: #0000FF; ">final</span> <span style="color: #0000FF; ">int</span> numberOfReplicas;  <br />       <span style="color: #0000FF; ">private</span> <span style="color: #0000FF; ">final</span> SortedMap<Integer, T> circle = <span style="color: #0000FF; ">new</span> TreeMap<Integer, T>();  <br />  <br />       <span style="color: #0000FF; ">public</span> ConsistentHash(HashFunction hashFunction, <span style="color: #0000FF; ">int</span> numberOfReplicas, Collection<T> nodes) {  <br />             <span style="color: #0000FF; ">this</span> .hashFunction = hashFunction;  <br />             <span style="color: #0000FF; ">this</span> .numberOfReplicas = numberOfReplicas;  <br />  <br />             <span style="color: #0000FF; ">for</span> (T node : nodes) {  <br />                  add(node);  <br />            }  <br />      }  <br />  <br />       <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">void</span> add(T node) {  <br />             <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">int</span> i = 0; i < numberOfReplicas; i++) {  <br />                   circle .put(hashFunction .hash(node.toString() + i), node);  <br />            }  <br />      }  <br />  <br />       <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">void</span> remove(T node) {  <br />             <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">int</span> i = 0; i < numberOfReplicas; i++) {  <br />                   circle .remove(hashFunction .hash(node.toString() + i));  <br />            }  <br />      }  <br />  <br />       <span style="color: #0000FF; ">public</span> T get(Object key) {  <br />             <span style="color: #0000FF; ">if</span> (circle .isEmpty()) {  <br />                   <span style="color: #0000FF; ">return</span> <span style="color: #0000FF; ">null</span> ;  <br />            }  <br />             <span style="color: #0000FF; ">int</span> hash = hashFunction .hash(key);  <br />             <span style="color: #008000; ">//</span><span style="color: #008000; "> System.out.println("hash---: " + hash);  </span><span style="color: #008000; "><br /></span>             <span style="color: #0000FF; ">if</span> (!circle .containsKey(hash)) {  <br />                  SortedMap<Integer, T> tailMap = circle .tailMap(hash);  <br />                  hash = tailMap.isEmpty() ? circle .firstKey() : tailMap.firstKey();  <br />            }  <br />             <span style="color: #008000; ">//</span><span style="color: #008000; "> System.out.println("hash---: " + hash);  </span><span style="color: #008000; "><br /></span>             <span style="color: #0000FF; ">return</span> circle .get(hash);  <br />      }  <br />  <br />       <span style="color: #0000FF; ">static</span> <span style="color: #0000FF; ">class</span> HashFunction {  <br />             <span style="color: #0000FF; ">int</span> hash(Object key) {<br />                   <span style="color: #008000; ">//</span><span style="color: #008000; ">md5鍔犲瘑鍚庯紝hashcode</span><span style="color: #008000; "><br /></span>                   <span style="color: #0000FF; ">return</span> Md5Encrypt.md5(key.toString()).hashCode();  <br />            }  <br />      }  <br />  <br />       <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">static</span> <span style="color: #0000FF; ">void</span> main(String [] args) {  <br />            HashSet< String> set = <span style="color: #0000FF; ">new</span> HashSet< String>();  <br />            set.add( "A" );  <br />            set.add( "B" );  <br />            set.add( "C" );  <br />            set.add( "D" );  <br />  <br />            Map< String, Integer> map = <span style="color: #0000FF; ">new</span> HashMap< String, Integer>();  <br />  <br />            ConsistentHash< String> consistentHash = <span style="color: #0000FF; ">new</span> ConsistentHash<String>( <span style="color: #0000FF; ">new</span> HashFunction(), 1000, set);  <br />  <br />             <span style="color: #0000FF; ">int</span> count = 10000;  <br />  <br />             <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">int</span> i = 0; i < count; i++) {  <br />                   String key = consistentHash.get(i);  <br />                   <span style="color: #0000FF; ">if</span> (map.containsKey(key)) {  <br />                        map.put(consistentHash.get(i), map.get(key) + 1);  <br />                  } <span style="color: #0000FF; ">else</span> {  <br />                        map.put(consistentHash.get(i), 1);  <br />                  }  <br />                   <span style="color: #008000; ">//</span><span style="color: #008000; "> System.out.println(key);  </span><span style="color: #008000; "><br /></span>            }  <br />  <br />             showServer(map);  <br />            map.clear();  <br />            consistentHash.remove( "A" );  <br />  <br />            System. out .println("------- remove A" );  <br />  <br />             <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">int</span> i = 0; i < count; i++) {  <br />                   String key = consistentHash.get(i);  <br />                   <span style="color: #0000FF; ">if</span> (map.containsKey(key)) {  <br />                        map.put(consistentHash.get(i), map.get(key) + 1);  <br />                  } <span style="color: #0000FF; ">else</span> {  <br />                        map.put(consistentHash.get(i), 1);  <br />                  }  <br />                   <span style="color: #008000; ">//</span><span style="color: #008000; "> System.out.println(key);  </span><span style="color: #008000; "><br /></span>            }  <br />  <br />             showServer(map);  <br />            map.clear();  <br />            consistentHash.add( "E" );  <br />            System. out .println("------- add E" );  <br />  <br />             <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">int</span> i = 0; i < count; i++) {  <br />                   String key = consistentHash.get(i);  <br />                   <span style="color: #0000FF; ">if</span> (map.containsKey(key)) {  <br />                        map.put(consistentHash.get(i), map.get(key) + 1);  <br />                  } <span style="color: #0000FF; ">else</span> {  <br />                        map.put(consistentHash.get(i), 1);  <br />                  }  <br />                   <span style="color: #008000; ">//</span><span style="color: #008000; "> System.out.println(key);  </span><span style="color: #008000; "><br /></span>            }  <br />  <br />             showServer(map);  <br />            map.clear();  <br />  <br />            consistentHash.add( "F" );  <br />            System. out .println("------- add F鏈嶅姟鍣?nbsp; 涓氬姟閲忓姞鍊? );  <br />            count = count * 2;  <br />             <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">int</span> i = 0; i < count; i++) {  <br />                  String key = consistentHash.get(i);  <br />                   <span style="color: #0000FF; ">if</span> (map.containsKey(key)) {  <br />                        map.put(consistentHash.get(i), map.get(key) + 1);  <br />                  } <span style="color: #0000FF; ">else</span> {  <br />                        map.put(consistentHash.get(i), 1);  <br />                  }  <br />                   <span style="color: #008000; ">//</span><span style="color: #008000; "> System.out.println(key);  </span><span style="color: #008000; "><br /></span>            }  <br />  <br />             showServer(map);  <br />  <br />      }  <br />  <br />       <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">static</span> <span style="color: #0000FF; ">void</span> showServer(Map<String , Integer> map) {  <br />             <span style="color: #0000FF; ">for</span> (Entry<String, Integer> m : map.entrySet()) {  <br />                  System. out .println("鏈嶅姟鍣?nbsp;" + m.getKey() + "----" + m.getValue() + "涓? );  <br />            }  <br />      }  <br />  <br />} </div><img src ="http://www.tkk7.com/jlin/aggbug/432831.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/jlin/" target="_blank">fly</a> 2017-09-26 00:20 <a href="http://www.tkk7.com/jlin/archive/2017/09/26/432831.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[鍘焆FastDFS錛?錛夛細(xì)Centos7 瀹夎FastDFS+nginx module(杞?http://www.tkk7.com/jlin/archive/2015/12/15/428661.htmlflyflyTue, 15 Dec 2015 06:22:00 GMThttp://www.tkk7.com/jlin/archive/2015/12/15/428661.htmlhttp://www.tkk7.com/jlin/comments/428661.htmlhttp://www.tkk7.com/jlin/archive/2015/12/15/428661.html#Feedback0http://www.tkk7.com/jlin/comments/commentRss/428661.htmlhttp://www.tkk7.com/jlin/services/trackbacks/428661.html鏈枃鍘熸枃榪炴帴: http://blog.csdn.net/freewebsys/article/details/45150941 杞澆璇鋒敞鏄庡嚭澶勶紒

1錛屽叧浜嶧astDFS

鎽樿嚜錛?a style="text-decoration: none; color: #000000;">http://www.oschina.net/p/fastdfs 
FastDFS鏄竴涓紑婧愮殑鍒嗗竷寮忔枃浠剁郴緇燂紝濂瑰鏂囦歡榪涜綆$悊錛屽姛鑳藉寘鎷細(xì)鏂囦歡瀛樺偍銆佹枃浠跺悓姝ャ佹枃浠惰闂紙鏂囦歡涓婁紶銆佹枃浠朵笅杞斤級絳夛紝瑙e喅浜嗗ぇ瀹歸噺瀛樺偍鍜岃礋杞藉潎琛$殑闂銆傜壒鍒傚悎浠ユ枃浠朵負(fù)杞戒綋鐨勫湪綰挎湇鍔★紝濡傜浉鍐岀綉绔欍佽棰戠綉绔欑瓑絳夈?/p>

FastDFS鏈嶅姟绔湁涓や釜瑙掕壊錛氳窡韙櫒錛坱racker錛夊拰瀛樺偍鑺傜偣錛坰torage錛夈傝窡韙櫒涓昏鍋氳皟搴﹀伐浣滐紝鍦ㄨ闂笂璧瘋礋杞藉潎琛$殑浣滅敤銆?/p>

瀛樺偍鑺傜偣瀛樺偍鏂囦歡錛屽畬鎴愭枃浠剁鐞嗙殑鎵鏈夊姛鑳斤細(xì)瀛樺偍銆佸悓姝ュ拰鎻愪緵瀛樺彇鎺ュ彛錛孎astDFS鍚屾椂瀵規(guī)枃浠剁殑meta data榪涜綆$悊銆傛墍璋撴枃浠剁殑meta data灝辨槸鏂囦歡鐨勭浉鍏沖睘鎬э紝浠ラ敭鍊煎錛坘ey value pair錛夋柟寮忚〃紺猴紝濡傦細(xì)width=1024錛屽叾涓殑key涓簑idth錛寁alue涓?024銆傛枃浠秏eta data鏄枃浠跺睘鎬у垪琛紝鍙互鍖呭惈澶氫釜閿煎銆?/p>

GitHub錛?a style="text-decoration: none; color: #000000;">https://github.com/happyfish100/fastdfs 
涓涓啓鐨勪笉閿欑殑鍗氬錛?a style="text-decoration: none; color: #000000;">http://tech.uc.cn/?p=221

2錛屽畨瑁匜astDFS

鍙傝冩枃妗o細(xì) 
https://github.com/happyfish100/fastdfs/blob/master/INSTALL

2.1錛屽畨瑁呯紪璇戝伐鍏?/h4>
yum -y groupinstall 'Development Tools'  yum -y install wget 

2.2錛屽畨瑁卨ibfastcommon綾誨簱

蹇呴』鍏堟寜鐓ц繖涓紝鍚﹀垯鎶ラ敊錛?/p>

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -DIOEVENT_USE_EPOLL -c -o ../common/fdfs_global.o ../common/fdfs_global.c  -I../common -I/usr/include/fastcommon ../common/fdfs_global.c:20:20: fatal error: logger.h: No such file or directory  #include "logger.h"                     ^ compilation terminated. ........

鐩存帴涓嬭澆瀹夎鍗沖彲錛?/p>

wget https://github.com/happyfish100/libfastcommon/archive/master.zip unzip master.zip cd libfastcommon-master ./make.sh ./make.sh install

2.3錛屽畨瑁匜astDFS

wget  https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz tar -zxvf V5.05.tar.gz  cd fastdfs-5.05/ ./make.sh ./make.sh install 

2.4錛屽惎鍔‵astDFS

瀹夎涔嬪悗閰嶇疆鏂囦歡鍦ㄧ洰褰?etc/fdfs銆?/p>

mv storage.conf.sample  storage.conf mv tracker.conf.sample tracker.conf

棣栧厛淇敼閰嶇疆鏂囦歡錛?nbsp;
/etc/fdfs/tracker.conf錛屼慨鏀硅礬寰勫埌/data/fdfs鐩綍銆?/p>

# the base path to store data and log files base_path=/data/fdfs

鍚姩錛?nbsp;
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start

淇敼閰嶇疆鏂囦歡錛?nbsp;
/etc/fdfs/storage.conf錛屼慨鏀硅礬寰勫埌/data/fdfs鐩綍錛屽悓鏃墮厤緗畉racker_server鍦板潃銆?/p>

# the base path to store data and log files base_path=/data/fdfs # tracker_server can ocur more than once, and tracker_server format is #  "host:port", host can be hostname or ip address tracker_server=192.168.1.36:22122 # store_path#, based 0, if store_path0 not exists, it's value is base_path # the paths must be exist store_path0=/data/fdfs #store_path1=/home/yuqing/fastdfs2

/usr/bin/fdfs_storaged /etc/fdfs/storage.conf start

鍚姩鐨勬椂鍊欙紝鐪嬫棩蹇楁病鏈夐敊璇氨璇存槑鍚姩鎴愬姛銆?nbsp;
鏌ョ湅fdfs榪涚▼錛?/p>

#ps -ef | grep fdfs root     19880     1  0 21:42 ?        00:00:00 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start root     20050     1  0 22:08 ?        00:00:00 /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start root     20060 19915  0 22:08 pts/1    00:00:00 grep --color=auto fdfs

2.5 瀹夎nginx + lua + fastdfs module 
涓嬭澆fastdfs-nginx-module妯″潡 
https://github.com/happyfish100/fastdfs-nginx-module 
涓嬭澆openresty nginx +lua鍖?/p>

wget https://github.com/happyfish100/fastdfs-nginx-module/archive/master.zip unzip fastdfs-nginx-module-master.zip wget http://openresty.org/download/ngx_openresty-1.7.10.1.tar.gz tar -zxvf ngx_openresty-1.7.10.1.tar.gz

緙栬瘧瀹夎錛氳繖閲屾敞鎰忎笅錛岄渶瑕佸鍔犲弬鏁般?nbsp;
涓涓槸stub_status緇熻妯″潡錛屼竴涓槸realip妯″潡銆?nbsp;
鍙傝冨湴鍧錛?nbsp;
http://blog.danielss.com/?p=80 
http://wiki.nginx.org/HttpRealipModuleChs

yum -y install pcre-devel openssl openssl-devel cd ngx_openresty-1.7.10.1 ./configure --with-luajit --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --add-module=/root/fastdfs-nginx-module-master/src  gmake gmake install

nginx +lua瀹夎璺緞錛?/p>

  nginx path prefix: "/usr/local/openresty/nginx"   nginx binary file: "/usr/local/openresty/nginx/sbin/nginx"   nginx configuration prefix: "/usr/local/openresty/nginx/conf"   nginx configuration file: "/usr/local/openresty/nginx/conf/nginx.conf"   nginx pid file: "/usr/local/openresty/nginx/logs/nginx.pid"   nginx error log file: "/usr/local/openresty/nginx/logs/error.log"   nginx http access log file: "/usr/local/openresty/nginx/logs/access.log"

鍚姩錛岄噸鍚痭ginx

#鍚姩 /usr/local/openresty/nginx/sbin/nginx #閲嶅惎  /usr/local/openresty/nginx/sbin/nginx -s restart

3錛屾祴璇旻astDFS

閰嶇疆鏈嶅姟錛?/p>

cd /etc/fdfs mv client.conf.sample client.conf

淇敼閰嶇疆錛?/p>

# the base path to store log files base_path=/data/fdfs  # tracker_server can ocur more than once, and tracker_server format is #  "host:port", host can be hostname or ip address tracker_server=192.168.1.36:22122

閰嶇疆nginx錛?/p>

cp /root/fastdfs-nginx-module-master/src/mod_fastdfs.conf /etc/fdfs/ mkdir /data/ngx

淇敼mod_fastdfs.conf閰嶇疆鏂囦歡錛氫慨鏀箃racker绔彛錛屽惁鍒檔ginx鍚姩涓嶄簡銆傝礬寰勪篃蹇呴』淇敼錛屽惁鍒欐壘涓嶅埌鏂囦歡銆?/p>

# the base path to store log files base_path=/data/ngx # FastDFS tracker_server can ocur more than once, and tracker_server format is #  "host:port", host can be hostname or ip address # valid only when load_fdfs_parameters_from_tracker is true tracker_server=192.168.1.36:22122 # store_path#, based 0, if store_path0 not exists, it's value is base_path # the paths must be exist # must same as storage.conf store_path0=/data/fdfs

鎷瘋礉閰嶇疆鏂囦歡錛屽惁鍒檔ginx鍚姩涓嶄簡錛屾姤閿欙細(xì)

[2015-04-28 11:30:14] ERROR - file: ini_file_reader.c, line: 315, include file "http.conf" not exists, line: "#include http.conf" [2015-04-28 11:30:14] ERROR - file: /root/fastdfs-nginx-module-master/src/common.c, line: 155, load conf file "/etc/fdfs/mod_fastdfs.conf" fail, ret code: 2 2015/04/28 11:30:14 [alert] 19969#0: worker process 2753 exited with fatal code 2 and cannot be respawned 

瑙e喅鍔炴硶錛?/p>

cp /root/fastdfs-master/conf/http.conf /root/fastdfs-master/conf/mime.types  /etc/fdfs

nginx閰嶇疆淇敼vi /usr/local/openresty/nginx/conf/nginx.conf

    server {         listen       80;         server_name  localhost;          charset utf8;          location /M00 {                 alias /data/fdfs/data;                 ngx_fastdfs_module;         }    ......

鍒涘緩榪炴帴

ln -s /data/fdfs/data /data/fdfs/data/M00

閲嶅惎nginx銆?nbsp;
嫻嬭瘯鍛戒護錛?/p>

echo "test fastdfs" > test.html  /usr/bin/fdfs_test /etc/fdfs/client.conf upload test.html

涓婁紶鎴愬姛錛屾墽琛岀粨鏋滐細(xì)

 This is FastDFS client test program v5.05  Copyright (C) 2008, Happy Fish / YuQing  FastDFS may be copied only under the terms of the GNU General Public License V3, which may be found in the FastDFS source kit. Please visit the FastDFS Home Page http://www.csource.org/ for more detail.  [2015-04-25 18:06:09] DEBUG - base_path=/data/fdfs, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0  tracker_query_storage_store_list_without_group:         server 1. group_name=, ip_addr=192.168.1.36, port=23000  group_name=group1, ip_addr=192.168.1.36, port=23000 storage_upload_by_filename group_name=group1, remote_filename=M00/00/00/wKgC1FU7ZxGAF19vAAAADcvBslg01.html source ip address: 192.168.1.36 file timestamp=2015-04-25 18:06:09 file size=13 file crc32=3418468952 example file url: http://192.168.1.36/group1/M00/00/00/wKgC1FU7ZxGAF19vAAAADcvBslg01.html storage_upload_slave_by_filename group_name=group1, remote_filename=M00/00/00/wKgC1FU7ZxGAF19vAAAADcvBslg01_big.html source ip address: 192.168.1.36 file timestamp=2015-04-25 18:06:09 file size=13 file crc32=3418468952 example file url: http://192.168.1.36/group1/M00/00/00/wKgC1FU7ZxGAF19vAAAADcvBslg01_big.html

嫻嬭瘯璁塊棶錛?/p>

curl http://192.168.1.36/M00/00/00/wKgC1FU7ZxGAF19vAAAADcvBslg01_big.html

濡傛灉榪斿洖“test fastdfs”璇存槑閰嶇疆鎴愬姛銆備笂闈㈢殑姣忎竴姝ヤ慨鏀歸兘瑕佹紜墠鍙互銆?/p>

鏌ョ湅nginx閿欒鏃ュ織錛?nbsp;
tail -f /usr/local/openresty/nginx/logs/error.log

4錛屾葷粨

FastDFS闈炲父濂界殑鍒嗗竷寮忔枃浠剁郴緇熴傞厤緗畝鍗曪紝鍙互澶氭満鍣ㄩ儴緗詫紝鍚屾椂瀹樻柟緇欎簡涓涓狽ginx妯″潡錛屽彲浠ョ洿鎺ョ敤nginx璁塊棶錛岄潪甯告柟渚褲傝繖鏍峰噺灝戜簡涓棿鐨則omcat灞傦紝鏁堢巼楂樸?nbsp;
鎺ヤ笅鏉ョ戶緇爺絀秎ua鐨勫浘鐗囧帇緙┿傜洿鎺ュ湪nginx灞傝繘琛屽浘鐗囧帇緙┿傛晥鐜囨洿楂橈紝鍚屾椂鍥劇墖璇誨彇FastDFS鐨勬枃浠躲?/p>

fly 2015-12-15 14:22 鍙戣〃璇勮
]]>
proxool璇︾粏閰嶇疆http://www.tkk7.com/jlin/archive/2015/01/28/422501.htmlflyflyWed, 28 Jan 2015 03:30:00 GMThttp://www.tkk7.com/jlin/archive/2015/01/28/422501.htmlhttp://www.tkk7.com/jlin/comments/422501.htmlhttp://www.tkk7.com/jlin/archive/2015/01/28/422501.html#Feedback0http://www.tkk7.com/jlin/comments/commentRss/422501.htmlhttp://www.tkk7.com/jlin/services/trackbacks/422501.html闃呰鍏ㄦ枃

fly 2015-01-28 11:30 鍙戣〃璇勮
]]>
Transaction has been rolled back because it has been marked as rollback(杞?http://www.tkk7.com/jlin/archive/2014/12/20/421587.htmlflyflySat, 20 Dec 2014 06:23:00 GMThttp://www.tkk7.com/jlin/archive/2014/12/20/421587.htmlhttp://www.tkk7.com/jlin/comments/421587.htmlhttp://www.tkk7.com/jlin/archive/2014/12/20/421587.html#Feedback0http://www.tkk7.com/jlin/comments/commentRss/421587.htmlhttp://www.tkk7.com/jlin/services/trackbacks/421587.html妗嗘灦閲囩敤鐨勬槸spring綆$悊澹版槑寮忎簨鍔★紝榪欏嚑澶╀笟鍔″紑鍙戞椂閬囧埌浜嗙偣楹葷儲錛岃褰曚笅澶囧繕銆?/p>

 

 鍦烘櫙錛氬湪Service綾諱腑浣跨敤瀛愪簨鍔?saveponit)鏃訛紝褰撳瓙浜嬪姟鎶涘嚭寮傚父鍚庯紝姝ゅ紓甯稿鐞嗘帀涓嶇戶緇線澶栨姏錛宻pring鍦ㄦ彁浜や富浜嬪姟鏃朵細(xì)鎶涘嚭

org.springframework.transaction.UnexpectedRollbackException: Transaction has been rolled back because it has been marked as rollback

 

 鏂規(guī)硶璋冪敤緇撴瀯錛?/p>

      鍋囪嫢鏈堿銆丅銆丆涓変釜Service綾伙紝鍏跺疄渚嬪璞″垎鍒負(fù)a銆乥銆乧,綾誨垎鍒畾涔夊涓嬶細(xì)

 

            A {

                    鏂規(guī)硶() {                   //propagation="REQUIRED"

  try{

 

                                b.鏂規(guī)硶();

   } catch (Exception e) {

           }

                    }      

   }

 

            B{

                     savePoint鏂規(guī)硶() {  //propagation="NESTED"

   c.鏂規(guī)硶(); //濡傛灉榪欓噷杈圭殑鎿嶄綔鍏ㄦ槸鏅氱被錛堜笉鏄疭ervice綾伙級鎿嶄綔錛屼笉浼?xì)鏈夐棶棰樸?/p>

                     }

             }

 

 

            C{

                      鏂規(guī)硶() {                 //propagation="REQUIRED"

  throw new Exception("鍑洪敊");

     }

 

              }

 

 

   閫氳繃璋冭瘯spring婧愮爜 

           ......

           Getting transaction for [A.鏂規(guī)硶] .....

           ......

   Creating nested transaction with name [B.savePoint鏂規(guī)硶]........

   ......

           Participating in existing transaction

           Getting transaction for [C.鏂規(guī)硶]

           ........

   Participating transaction failed - marking existing transaction as rollback-only

           //姝ゆ椂錛屽凡鎶婁富浜嬪姟鏍囪鎴愪簡rollback-only

 

           鎵浠ワ紝褰撳湪a.鏂規(guī)硶瀹屾垚鏃舵彁浜や簨鍔℃椂浼?xì)鎶ransaction has been rolled back because it has been marked as rollback閿欒銆?/p>

 

           璁ょ湡鐨勬?zhèn)ㄥ彲鑳戒細(xì)鍙戠帋图屽?org.springframework.transaction.support.AbstractPlatformTransactionManager 涓湁涓彨

isGlobalRollbackOnParticipationFailure鐨勫弬鏁幫紝榛樿鏄痶rue.

 

          婧愮爜涓鏄庯細(xì)

 

        Switch this to "false" to let the transaction originator make the rollback decision. If a participating transaction fails with an exception, the caller can still decide to continue with a different path within the transaction. However, note that this will only work as long as all participating resources are capable of continuing towards a transaction commit even after a data access failure: This is generally not the case for a Hibernate Session, for example; neither is it for a sequence of JDBC insert/update/delete operations.

 

          澶ф剰鏄細(xì)濡傛灉isGlobalRollbackOnParticipationFailure涓篺alse,鍒欎細(xì)璁╀富浜嬪姟鍐沖畾鍥炴粴錛屽鏋滃綋閬囧埌exception鍔犲叆浜嬪姟澶辮觸鏃訛紝璋冪敤鑰呰兘緇х畫鍦ㄤ簨鍔″唴鍐沖畾鏄洖婊氳繕鏄戶緇傜劧鑰岋紝瑕佹敞鎰忔槸閭f牱鍋氫粎浠呴傜敤浜庡湪鏁版嵁璁塊棶澶辮觸鐨勬儏鍐典笅涓斿彧瑕佹墍鏈夋搷浣滀簨鍔¤兘鎻愪氦銆?/p>

 

        

    鍒濇瑙e喅鏂規(guī)錛?/p>

<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> <property name="globalRollbackOnParticipationFailure" value="false" /> <!--鎸囧畾姝ゅ弬鏁頒負(fù)false-->

</bean>

 

 

    緇忔祴璇曪紝姝ら棶棰樻殏鏃跺緱鍒拌В鍐籌紝涓嶇煡閬撲細(xì)涓嶄細(xì)寮曡搗鍏跺畠闂錛岃嚦灝戠洰鍓嶈繕娌℃湁鍙戠幇鍏跺畠寮傚父銆傛?zhèn)ㄨ嫢閫氳繃姝ゆ柟妗堣В鍐充箣鍚庡嚭鐜頒簡鏂扮殑闂璇風(fēng)暀淇″洖澶嶏紝鎴戜滑涓璧蜂氦嫻侊紝闈炲父鎰熻阿錛?/p>

 



fly 2014-12-20 14:23 鍙戣〃璇勮
]]>
jaxb鐨勮В鏋恱ml鍜岀敓鎴恱ml鍒楀瓙http://www.tkk7.com/jlin/archive/2014/12/11/421277.htmlflyflyThu, 11 Dec 2014 06:44:00 GMThttp://www.tkk7.com/jlin/archive/2014/12/11/421277.htmlhttp://www.tkk7.com/jlin/comments/421277.htmlhttp://www.tkk7.com/jlin/archive/2014/12/11/421277.html#Feedback0http://www.tkk7.com/jlin/comments/commentRss/421277.htmlhttp://www.tkk7.com/jlin/services/trackbacks/421277.html
<?xml version="1.0" encoding="UTF-8"?>
<trans>
<tran>
<requestId>111111</requestId>
<orderNo>13141322</orderNo>
<returnCode>000001</returnCode>
<returnInfo>浜ゆ槗澶辮觸</returnInfo>
</tran>
<tran>
<requestId>2222222</requestId>
<orderNo>13141323</orderNo>
<returnCode>000000</returnCode>
<returnInfo>浜ゆ槗鎴愬姛</returnInfo>
</tran>
</trans>
寤虹珛瀵瑰簲鐨凧AVA bean綾?br />
Trans.java綾?/div>
package com.jaxb.test;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "trans")
@XmlAccessorType(XmlAccessType.FIELD)
public class Trans{
@XmlElement(name = "tran")
private List<Tran> data = null;
public List<Tran> getData() {
return data;
}
public void setData(List<Tran> data) {
this.data = data;
}
}
Tran.java綾?/div>
package com.jaxb.test;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
@XmlAccessorType(XmlAccessType.FIELD)
public class Tran {
@XmlElement(name = "requestId")
private Long requestId;
@XmlElement(name = "orderNo")
private Long orderNo;
@XmlElement(name = "returnCode")
private String returnCode;
@XmlElement(name = "returnInfo")
private String returnInfo;
public Long getRequestId() {
return requestId;
}
public void setRequestId(Long requestId) {
this.requestId = requestId;
}
public Long getOrderNo() {
return orderNo;
}
public void setOrderNo(Long orderNo) {
this.orderNo = orderNo;
}
public String getReturnCode() {
return returnCode;
}
public void setReturnCode(String returnCode) {
this.returnCode = returnCode;
}
public String getReturnInfo() {
return returnInfo;
}
public void setReturnInfo(String returnInfo) {
this.returnInfo = returnInfo;
}
}
寤虹珛嫻嬭瘯綾?br />
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
public class TestJAXB {
public static void main(String[] args) {
try {
//read xml file to Java object
Trans trans = TestJAXB.readString(Trans.class,"input.xml");
List<Tran> datas = trans.getDatas();
for (Tran o : datas) {
System.out.println(o.getReturnCode()+";"+o.getReturnInfo());
}
//write java object to xml
Tran tran = new Tran();
      tran.setOrderNo(11111L);
      tran.setRequestId(22222L);
      tran.setReturnCode("0000");
      tran.setReturnInfo("success");
      Tran tran2 = new Tran();
      tran2.setOrderNo(33333L);
      tran2.setRequestId(44444L);
      tran2.setReturnCode("0001");
      tran2.setReturnInfo("failure");
      Trans trxs = new Trans();
      List<Tran> list = new ArrayList<Tran>(); 
      list.add(tran);
      list.add(tran2);
      trxs.setDatas(list);
File file = new File("D:/output.xml");
JAXBContext jaxbContext = JAXBContext.newInstance(Trans.class);
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
// output pretty printed
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
jaxbMarshaller.marshal(trxs, file);
jaxbMarshaller.marshal(trxs, System.out);
} catch (JAXBException e) {
e.printStackTrace();
}
}
@SuppressWarnings("unchecked")
public static <T> T readString(Class<T> clazz, String context) throws JAXBException {
try {
JAXBContext jc = JAXBContext.newInstance(clazz);
Unmarshaller u = jc.createUnmarshaller();
return (T) u.unmarshal(new File(context));
} catch (JAXBException e) {
throw e;
}
}
}


fly 2014-12-11 14:44 鍙戣〃璇勮
]]>Hibernate4涔婮PA瑙勮寖閰嶇疆璇﹁В(杞?http://www.tkk7.com/jlin/archive/2014/10/29/419162.htmlflyflyWed, 29 Oct 2014 06:15:00 GMThttp://www.tkk7.com/jlin/archive/2014/10/29/419162.htmlhttp://www.tkk7.com/jlin/comments/419162.htmlhttp://www.tkk7.com/jlin/archive/2014/10/29/419162.html#Feedback0http://www.tkk7.com/jlin/comments/commentRss/419162.htmlhttp://www.tkk7.com/jlin/services/trackbacks/419162.html闃呰鍏ㄦ枃

fly 2014-10-29 14:15 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 两个人的视频高清在线观看免费| 亚洲a∨无码精品色午夜| 中文字幕精品亚洲无线码一区| 国产乱人免费视频| 免费国产a国产片高清| 日韩高清免费在线观看| 青青青青青青久久久免费观看| 美女被免费视频网站a国产| 永久免费看bbb| 亚洲av麻豆aⅴ无码电影| 亚洲欧洲中文日韩久久AV乱码| 国产亚洲成人久久| 亚洲AV永久无码精品水牛影视| 亚洲AV午夜成人片| 亚洲毛片无码专区亚洲乱| 亚洲午夜精品国产电影在线观看| 国产成人精品日本亚洲专| 亚洲成熟丰满熟妇高潮XXXXX| 瑟瑟网站免费网站入口| 亚洲免费一区二区| 日韩精品无码免费一区二区三区| 0588影视手机免费看片| 成人无码区免费视频观看| 国产成人免费ā片在线观看| 亚洲综合精品网站在线观看| 国产精一品亚洲二区在线播放| 亚洲乱亚洲乱淫久久| 亚洲日本人成中文字幕| 无码色偷偷亚洲国内自拍| 2022免费国产精品福利在线| 欧洲精品99毛片免费高清观看| 和日本免费不卡在线v| 免费一级毛片一级毛片aa| 国产成A人亚洲精V品无码| 亚洲另类精品xxxx人妖| 国产精品亚洲综合| 国产在线一区二区综合免费视频| 99在线精品免费视频九九视| 免费人成在线观看播放国产 | 中文字幕视频免费在线观看| 色欲A∨无码蜜臀AV免费播 |