锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲视频国产,欧美精品一二三四,亚洲a一区二区三区http://www.aygfsteel.com/wuxufeng8080/category/12031.html寮辨按涓夊崈錛屽彧鍙栦竴鐡紝渚胯兘瑙f復錛涗經(jīng)娉曟棤杈癸紝濂夎涓娉曪紝渚胯兘寰楃泭銆?/description>zh-cnMon, 12 Mar 2018 12:55:29 GMTMon, 12 Mar 2018 12:55:29 GMT60spring quartz 涓茶閰嶇疆http://www.aygfsteel.com/wuxufeng8080/archive/2018/03/12/433096.html椋庝漢鍥?/dc:creator>椋庝漢鍥?/author>Mon, 12 Mar 2018 11:58:00 GMThttp://www.aygfsteel.com/wuxufeng8080/archive/2018/03/12/433096.htmlhttp://www.aygfsteel.com/wuxufeng8080/comments/433096.htmlhttp://www.aygfsteel.com/wuxufeng8080/archive/2018/03/12/433096.html#Feedback0http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/433096.htmlhttp://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 GMThttp://www.aygfsteel.com/wuxufeng8080/archive/2016/11/08/431964.htmlhttp://www.aygfsteel.com/wuxufeng8080/comments/431964.htmlhttp://www.aygfsteel.com/wuxufeng8080/archive/2016/11/08/431964.html#Feedback0http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/431964.htmlhttp://www.aygfsteel.com/wuxufeng8080/services/trackbacks/431964.htmlspring 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 GMThttp://www.aygfsteel.com/wuxufeng8080/archive/2010/12/30/341996.htmlhttp://www.aygfsteel.com/wuxufeng8080/comments/341996.htmlhttp://www.aygfsteel.com/wuxufeng8080/archive/2010/12/30/341996.html#Feedback0http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/341996.htmlhttp://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><link>http://www.aygfsteel.com/wuxufeng8080/archive/2010/12/14/340637.html</link><dc:creator>椋庝漢鍥?/dc:creator><author>椋庝漢鍥?/author><pubDate>Tue, 14 Dec 2010 06:01:00 GMT</pubDate><guid>http://www.aygfsteel.com/wuxufeng8080/archive/2010/12/14/340637.html</guid><wfw:comment>http://www.aygfsteel.com/wuxufeng8080/comments/340637.html</wfw:comment><comments>http://www.aygfsteel.com/wuxufeng8080/archive/2010/12/14/340637.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/340637.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wuxufeng8080/services/trackbacks/340637.html</trackback:ping><description><![CDATA[    spring鐨勪簨鐗╅厤緗紝榛樿鐘舵佷笅錛屽彧閽堝銆RuntimeException銆榪涜鍥炴粴銆?br /> 鑰屽儚錛籌急錛譏锝橈絻锝咃綈锝旓綁锝忥綆騫朵笉鏄疪untimeException錛屾墍浠ヨ繖閲岄渶瑕佺壒鍒敞鎰忋?br /> <br /> 榪欓噷鍥版壈浜嗘垜寰堜箙錛屼竴鐩存病鏈夋兂鏄庣櫧涓轟粈涔堝湪涓涓簨鍔¢噷闈紝閮ㄥ垎鎴愬姛錛岄儴鍒嗗け璐ャ傚彲鑳藉氨鏄繖涓師鍥犲鑷寸殑銆?br /> 涔熷氨鏄錛屼竴浜涚郴緇熺駭鍒殑寮傚父錛屽墠鏈熼兘闇瑕佽漿鍖栨垚銆RuntimeException銆銆傝繖鏍峰氨鍙互榪涜鍥炴粴浜嗐?br /> <br /> 浣嗘槸榪欐牱鐨勫彧闇瑕佷慨鏀瑰簳灞傦紝鍙﹀涓涓伔鎳掔殑鏂規(guī)硶錛屽湪姣忎釜锝擄絽锝掞綎锝夛絻锝呯被涓婄洿鎺ユ寚瀹歳ollback = Exception.class銆傝繖鏍鋒墍鏈夌殑寮傚父閮戒細鍥炴粴銆備絾鏄繖鏍鋒湁娌℃湁鍓綔鐢紝浣嗘槸涓嶆竻妤氥?br /> <br /> 寮傚父涓鐩存槸鎴戞病鏈夋悶瀹氱殑涓鍧楀唴瀹逛箣涓錛岀О榪欎釜鏈轟細鐮旂┒涓涓嬨?br /> 涓轟粈涔堥渶瑕佸垎check 鍜寀nckeck錛屼袱鑰呮湁浠涔堜笉鍔ㄧ偣銆?br /> 濡傛灉閮芥槸鐢╱ncheck錛屼細涓嶄細鏈変粈涔堥棶棰橈紵<br /> 寰呯畫銆傘傘? <img src ="http://www.aygfsteel.com/wuxufeng8080/aggbug/340637.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wuxufeng8080/" target="_blank">椋庝漢鍥?/a> 2010-12-14 14:01 <a href="http://www.aygfsteel.com/wuxufeng8080/archive/2010/12/14/340637.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>spring mvc鐨勫父瑙侀棶棰?/title><link>http://www.aygfsteel.com/wuxufeng8080/archive/2008/03/24/188156.html</link><dc:creator>椋庝漢鍥?/dc:creator><author>椋庝漢鍥?/author><pubDate>Mon, 24 Mar 2008 02:23:00 GMT</pubDate><guid>http://www.aygfsteel.com/wuxufeng8080/archive/2008/03/24/188156.html</guid><wfw:comment>http://www.aygfsteel.com/wuxufeng8080/comments/188156.html</wfw:comment><comments>http://www.aygfsteel.com/wuxufeng8080/archive/2008/03/24/188156.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/188156.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wuxufeng8080/services/trackbacks/188156.html</trackback:ping><description><![CDATA[<p>1錛屼嬌鐢╪ew ModelAndView鏉ヨ繑鍥為〉闈紝鍙橀噺闇瑕佽窡鍦ㄨ繖涓被涓洿鎺ヨ繑鍥烇紝浣跨敤modelMap.addAttribute("message", message);鍦ㄩ〉闈笂浣跨敤EL琛ㄨ揪寮忔棤娉曡幏寰楀彉閲忋傛劅瑙変嬌鐢╪ew ModelAndView鍥炲埌欏甸潰涓嶈兘鍚孧odelMap鍚屾椂浣跨敤銆?br /> </p> <p>2錛宖orm 鐨勬槧灝勶紝spring mvc涓紝浣跨敤榛樿鏄犲皠灝卞彲浠ワ紝濡傛灉闇瑕佹槧灝勫埌涓涓璞′腑錛岀洿鎺ュ湪鏂規(guī)硶涓寚瀹氳繖涓璞″0鏄庡氨鍙互錛岃繖鏍穎orm鎻愪氦鏃朵細灝嗗睘鎬х粦瀹氬埌鍚屽悕鐨勫睘鎬т腑銆傛瘮鍘熺増鐨勯厤緗槧灝勮綆鍗曞緢澶氾紝鑰屼笖涓嶉渶瑕佺戶鎵縁ormBean綾伙紝姣攕truts涔熺畝鍗曪紝濂界敤寰堝銆?/p> <img src ="http://www.aygfsteel.com/wuxufeng8080/aggbug/188156.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wuxufeng8080/" target="_blank">椋庝漢鍥?/a> 2008-03-24 10:23 <a href="http://www.aygfsteel.com/wuxufeng8080/archive/2008/03/24/188156.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring MVC Annotationhttp://www.aygfsteel.com/wuxufeng8080/archive/2008/01/10/174255.html椋庝漢鍥?/dc:creator>椋庝漢鍥?/author>Thu, 10 Jan 2008 05:35:00 GMThttp://www.aygfsteel.com/wuxufeng8080/archive/2008/01/10/174255.htmlhttp://www.aygfsteel.com/wuxufeng8080/comments/174255.htmlhttp://www.aygfsteel.com/wuxufeng8080/archive/2008/01/10/174255.html#Feedback0http://www.aygfsteel.com/wuxufeng8080/comments/commentRss/174255.htmlhttp://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>

]]>
主站蜘蛛池模板: 巴彦县| 江安县| 武山县| 虞城县| 郁南县| 泰和县| 青河县| 凉城县| 万山特区| 沂水县| 北流市| 根河市| 南靖县| 高密市| 鹤山市| 陇川县| 永靖县| 普兰店市| 巴林右旗| 芦溪县| 兴城市| 香港| 平阳县| 扶余县| 乾安县| 灵台县| 百色市| 方山县| 哈巴河县| 宜黄县| 玛曲县| 长丰县| 钦州市| 敖汉旗| 广德县| 南岸区| 凯里市| 迭部县| 太湖县| 遵义县| 蒙自县|