本文参考《精通Spring:JavaWeb开发技术详解》 孙卫琴 ,清华大学出版社出版package  mypack;import  org.springframework.web.bind.annotation.ControllerAdvice;import  org.springframework.web.bind.annotation.ModelAttribute;import  java.util.*;public  class  MyControllerAdvice {public  Map<String,String> setColors() {new  HashMap<String,String>();return  colors;
@RequestMapping(value="/testColor")public  String testColor(return  "result"; 
http://localhost:8080/helloapp/testColor?name=Tom //增强PersonController和TestAttributeController的功能 @ControllerAdvice(assignableTypes={PersonController.class,public  class  MyControllerAdvice1{……}//增强mypack包和net.javathinker包中的控制器类的功能 @ControllerAdvice(basePackages ={"mypack","net.javathinker"})public  class  MyControllerAdvice2{……}
www.javathinker.net  
        
      
 
网站系统异常 
    
     系统异常信息  
    
     
       
         Request URL: 
http://www.javathinker.net/WEB-INF/lybbs/jsp/topic.jsp?postID=3968&pages=4本站管理人员 。