锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲视频国产,欧美精品一二三四,亚洲a一区二区三区 http://www.aygfsteel.com/wuxufeng8080/category/12031.html寮辨按涓夊崈錛屽彧鍙栦竴鐡紝渚胯兘瑙f復錛涗經(jīng)娉曟棤杈癸紝濂夎涓娉曪紝渚胯兘寰楃泭銆?/description>zh-cn Mon, 12 Mar 2018 12:55:29 GMT Mon, 12 Mar 2018 12:55:29 GMT 60 spring quartz 涓茶閰嶇疆 http://www.aygfsteel.com/wuxufeng8080/archive/2018/03/12/433096.html椋庝漢鍥?/dc:creator>椋庝漢鍥?/author>Mon, 12 Mar 2018 11:58:00 GMT http://www.aygfsteel.com/wuxufeng8080/archive/2018/03/12/433096.html http://www.aygfsteel.com/wuxufeng8080/comments/433096.html http://www.aygfsteel.com/wuxufeng8080/archive/2018/03/12/433096.html#Feedback 0 http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/433096.html http://www.aygfsteel.com/wuxufeng8080/services/trackbacks/433096.html <bean id="jobDetail7"class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<propertyname="targetObject" ref="billingBillTask"></property>
<propertyname="targetMethod" value="executeInternal" />
<propertyname="concurrent" value="false" />
</bean>
<beanid="billingBillTask"class="com.dangdang.tms.job.schedule.bms.BillingBillTask"/>
<beanid="cronTriggerBean7" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<propertyname="jobDetail" ref="jobDetail7"></property>
<propertyname="cronExpression" value="0/5 * * * * ?"></property>
</bean> 鍙傝?http://blog.csdn.net/lkforce/article/details/51841890
]]>spring mvc @ExceptionHandler 寮傚父澶勭悊 http://www.aygfsteel.com/wuxufeng8080/archive/2016/11/08/431964.html椋庝漢鍥?/dc:creator>椋庝漢鍥?/author>Tue, 08 Nov 2016 00:32:00 GMT http://www.aygfsteel.com/wuxufeng8080/archive/2016/11/08/431964.html http://www.aygfsteel.com/wuxufeng8080/comments/431964.html http://www.aygfsteel.com/wuxufeng8080/archive/2016/11/08/431964.html#Feedback 0 http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/431964.html http://www.aygfsteel.com/wuxufeng8080/services/trackbacks/431964.html spring mvc 緇熶竴鐨勫紓甯稿鐞嗭紝鏈変袱縐嶆柟寮忋?br />涓銆乪xceptionResolver 浜屻丒xceptionHandler 涓よ呬笉鑳藉悓鏃墮厤緗傚鏋滈厤緗簡絎竴縐嶏紝鍒欑浜岀鏃犳晥銆傚氨鍥犱負榪欎釜鍘熷洜錛屾壘浜嗕竴澶╃殑闂銆?br /> ExceptionHandler 閫氳繃娉ㄨВ鐨勬柟寮忥紝榪涜閰嶇疆錛屽彧闇瑕佸湪鏌愪釜controller 涓緗簡榪欎釜娉ㄨВ錛屽垯榪欎釜controller涓殑鎵鏈夊紓甯擱兘浼氶氳繃榪欎釜鏂規(guī)硶榪涜澶勭悊銆?br /> 姣斿rest controller錛屽鍔犱竴涓?
@ExceptionHandler public String exp(HttpServletRequest request, Exception ex) { Map map = new HashMap(); logger.error( " error, " + UUID.randomUUID().toString(), ex); request.setAttribute( " ex " , ex); String msg = ex.getMessage(); map.put(" success " , " 0 " ); map.put( " msg " , msg); String rtnjson = JSONUtil.objectToJson(map); request.setAttribute( " json " , rtnjson); return " json " ; } 榪欐牱錛岃繖涓猚ontroler涓殑寮傚父錛岄兘浼氱敱榪欎釜寮傚父澶勭悊鏂規(guī)硶錛岃繘琛岀粺涓澶勭悊錛岀敓鎴愬紓甯竕son銆傞伩鍏嶅湪鍚勪釜鏂規(guī)硶涓氳繃try catch 鐨勬柟娉曪紝榪涜寮傚父澶勭悊銆?br /> ]]> Spring MVC 浣跨敤涓殑娉ㄦ剰浜嬮」 http://www.aygfsteel.com/wuxufeng8080/archive/2010/12/30/341996.html椋庝漢鍥?/dc:creator>椋庝漢鍥?/author>Thu, 30 Dec 2010 07:51:00 GMT http://www.aygfsteel.com/wuxufeng8080/archive/2010/12/30/341996.html http://www.aygfsteel.com/wuxufeng8080/comments/341996.html http://www.aygfsteel.com/wuxufeng8080/archive/2010/12/30/341996.html#Feedback 0 http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/341996.html http://www.aygfsteel.com/wuxufeng8080/services/trackbacks/341996.html ModelAndView涓繚瀛樹簡瑕佷紶閫掔粰瑙嗗浘鐨勫璞″拰鍏蜂綋瑕佷嬌鐢ㄧ殑瑙嗗浘鏂囦歡錛岃嚜2.0璧鳳紝 Spring MVC鎻愪緵浜咰onvention over Configuration鐨勬満鍒訛紝澶уぇ綆鍖栦簡浠g爜涓庨厤緗傜畝鍗曞湴璇達紝鍚嶅瓧浠ontroller緇撳熬鐨勬帶鍒跺櫒綾婚兘浼氳鏄犲皠涓虹浉搴旂殑鍦板潃錛孡istArticleController瀵瑰簲/listarticle*錛屽鏋滄槸MultiActionController鍒欎細琚槧灝勪負涓涓洰褰曪紱鍚慚odelAndView娣誨姞瀵硅薄鏃跺彲浠ヤ笉鐢ㄦ寚瀹氶敭錛坘ey錛夛紝鍗曚竴瀵硅薄鐨勯敭鍙栧喅浜庣被鍚嶏紝姣斿x.y.User鐨勯敭鏄痷ser錛岃屾煇涓綾誨璞$殑 Set銆丩ist鎴栨暟緇勫垯紼嶆湁浜涘鏉傦紝鍙栫涓涓璞$殑綾誨悕鍔犱笂“List”浣滀負瀹冪殑閿紝姣斿榪欓噷鐨刟rticles鏄竴涓瓨鏀続rticle瀵硅薄鐨?List錛屽畠鐨勯敭灝辨槸articleList錛?/span>
涔熷彲浠ラ氳繃鎵цkey錛屾潵鎸囧畾鍙橀噺鍚嶇О
]]> spring 浜嬪姟鐨勫洖婊氶棶棰?/title> http://www.aygfsteel.com/wuxufeng8080/archive/2010/12/14/340637.html椋庝漢鍥?/dc:creator>椋庝漢鍥?/author>Tue, 14 Dec 2010 06:01:00 GMT http://www.aygfsteel.com/wuxufeng8080/archive/2010/12/14/340637.html http://www.aygfsteel.com/wuxufeng8080/comments/340637.html http://www.aygfsteel.com/wuxufeng8080/archive/2010/12/14/340637.html#Feedback 1 http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/340637.html http://www.aygfsteel.com/wuxufeng8080/services/trackbacks/340637.html
鑰屽儚錛籌急錛譏锝橈絻锝咃綈锝旓綁锝忥綆騫朵笉鏄疪untimeException錛屾墍浠ヨ繖閲岄渶瑕佺壒鍒敞鎰忋?br />
榪欓噷鍥版壈浜嗘垜寰堜箙錛屼竴鐩存病鏈夋兂鏄庣櫧涓轟粈涔堝湪涓涓簨鍔¢噷闈紝閮ㄥ垎鎴愬姛錛岄儴鍒嗗け璐ャ傚彲鑳藉氨鏄繖涓師鍥犲鑷寸殑銆?br />
涔熷氨鏄錛屼竴浜涚郴緇熺駭鍒殑寮傚父錛屽墠鏈熼兘闇瑕佽漿鍖栨垚銆RuntimeException銆銆傝繖鏍峰氨鍙互榪涜鍥炴粴浜嗐?br />
浣嗘槸榪欐牱鐨勫彧闇瑕佷慨鏀瑰簳灞傦紝鍙﹀涓涓伔鎳掔殑鏂規(guī)硶錛屽湪姣忎釜锝擄絽锝掞綎锝夛絻锝呯被涓婄洿鎺ユ寚瀹歳ollback = Exception.class銆傝繖鏍鋒墍鏈夌殑寮傚父閮戒細鍥炴粴銆備絾鏄繖鏍鋒湁娌℃湁鍓綔鐢紝浣嗘槸涓嶆竻妤氥?br />
寮傚父涓鐩存槸鎴戞病鏈夋悶瀹氱殑涓鍧楀唴瀹逛箣涓錛岀О榪欎釜鏈轟細鐮旂┒涓涓嬨?br />
涓轟粈涔堥渶瑕佸垎check 鍜寀nckeck錛屼袱鑰呮湁浠涔堜笉鍔ㄧ偣銆?br />
濡傛灉閮芥槸鐢╱ncheck錛屼細涓嶄細鏈変粈涔堥棶棰橈紵
寰呯畫銆傘傘?
]]> spring mvc鐨勫父瑙侀棶棰?/title> http://www.aygfsteel.com/wuxufeng8080/archive/2008/03/24/188156.html椋庝漢鍥?/dc:creator>椋庝漢鍥?/author>Mon, 24 Mar 2008 02:23:00 GMT http://www.aygfsteel.com/wuxufeng8080/archive/2008/03/24/188156.html http://www.aygfsteel.com/wuxufeng8080/comments/188156.html http://www.aygfsteel.com/wuxufeng8080/archive/2008/03/24/188156.html#Feedback 0 http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/188156.html http://www.aygfsteel.com/wuxufeng8080/services/trackbacks/188156.html 1錛屼嬌鐢╪ew ModelAndView鏉ヨ繑鍥為〉闈紝鍙橀噺闇瑕佽窡鍦ㄨ繖涓被涓洿鎺ヨ繑鍥烇紝浣跨敤modelMap.addAttribute("message", message);鍦ㄩ〉闈笂浣跨敤EL琛ㄨ揪寮忔棤娉曡幏寰楀彉閲忋傛劅瑙変嬌鐢╪ew ModelAndView鍥炲埌欏甸潰涓嶈兘鍚孧odelMap鍚屾椂浣跨敤銆?br />
2錛宖orm 鐨勬槧灝勶紝spring mvc涓紝浣跨敤榛樿鏄犲皠灝卞彲浠ワ紝濡傛灉闇瑕佹槧灝勫埌涓涓璞′腑錛岀洿鎺ュ湪鏂規(guī)硶涓寚瀹氳繖涓璞″0鏄庡氨鍙互錛岃繖鏍穎orm鎻愪氦鏃朵細灝嗗睘鎬х粦瀹氬埌鍚屽悕鐨勫睘鎬т腑銆傛瘮鍘熺増鐨勯厤緗槧灝勮綆鍗曞緢澶氾紝鑰屼笖涓嶉渶瑕佺戶鎵縁ormBean綾伙紝姣攕truts涔熺畝鍗曪紝濂界敤寰堝銆?/p>
]]> Spring MVC Annotation http://www.aygfsteel.com/wuxufeng8080/archive/2008/01/10/174255.html椋庝漢鍥?/dc:creator>椋庝漢鍥?/author>Thu, 10 Jan 2008 05:35:00 GMT http://www.aygfsteel.com/wuxufeng8080/archive/2008/01/10/174255.html http://www.aygfsteel.com/wuxufeng8080/comments/174255.html http://www.aygfsteel.com/wuxufeng8080/archive/2008/01/10/174255.html#Feedback 0 http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/174255.html http://www.aygfsteel.com/wuxufeng8080/services/trackbacks/174255.html
娉細涓ょurlmapping鐨勬ā寮忎笉鑳藉悓鏃朵嬌鐢紝濡傛灉浣跨敤annotation灝變笉鑳藉啀閰嶇疆springapp-servlet.xml鐨剈rlmapping銆?br />
1銆亁ml閰嶇疆
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<context:component-scan base-package="com.ivo.web.action.spring" />
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property>
<property name="prefix"><value>/pages/</value></property>
<property name="suffix"><value>.jsp</value></property>
</bean>
</beans>
<context:component-scan base-package="com.ivo.web.action.spring" />鐢ㄤ簬鎸囨槑緋葷粺浠庡摢涓礬寰勪笅瀵繪壘controller錛岀劧鍚庢彁鍓嶅垵濮嬪寲榪欎簺瀵硅薄銆?br />
2銆亀eb.xml
璺熶竴鑸殑mvc閰嶇疆娌℃湁鍖哄埆銆?br />
3銆乧ontroller閰嶇疆
鍏蜂綋鍙互鐪媠pring鐨勫弬鑰冩枃浠訛紝鏈夊ソ鍑犵閰嶇疆銆?br />
3.1 鍦ㄦ柟娉曚笂閰嶇疆mapping璺緞
@Controller
public class HelloController {
@RequestMapping("/hello.do")
public ModelAndView processImageUpload() throws IOException {
System.out.println("hello");
return new ModelAndView("org", "jsonString", "test");
}
}
3.2 鍦╟lass涓婇厤緗甿apping璺緞錛岄氳繃鍙傛暟鎸囧畾璋冪敤鐨勬柟娉?br />
@Controller
@RequestMapping("/hello.do")
public class HelloController {
@RequestMapping(params = "action=save" )
public ModelAndView save() throws IOException {
System.out.println("hello");
return new ModelAndView("org", "jsonString", "test");
}
}
鏂規(guī)硶鐨勮繑鍥炲煎彲浠ユ槸null錛宻tring 鎴栬匨odelAndView錛岄兘鏀寔銆?br />
浠ヤ笂鏄郴緇熸殏鏃剁敤鍒扮殑錛屽叾浠栫殑浠ュ悗鍐嶇爺絀躲?/p>
]]>
主站蜘蛛池模板:
巴彦县 |
江安县 |
武山县 |
虞城县 |
郁南县 |
泰和县 |
青河县 |
凉城县 |
万山特区 |
沂水县 |
北流市 |
根河市 |
南靖县 |
高密市 |
鹤山市 |
陇川县 |
永靖县 |
普兰店市 |
巴林右旗 |
芦溪县 |
兴城市 |
香港 |
平阳县 |
扶余县 |
乾安县 |
灵台县 |
百色市 |
方山县 |
哈巴河县 |
宜黄县 |
玛曲县 |
长丰县 |
钦州市 |
敖汉旗 |
广德县 |
南岸区 |
凯里市 |
迭部县 |
太湖县 |
遵义县 |
蒙自县 |