- 在Controller类的内部方法上使用@ExceptionHandler,则此类的方法抛出未处理的异常时,回到此方法上处理。
 
- @ExceptionHandler可以指定异常的类型,会自动进行匹配
 
- 如果需要全局配置,可以在类上使用@ControllerAdvice
 
 <bean class="org.springframework.web.serlect.handler.SimpleMappingExceeptionResolver">
     
     <!-- 为所有的异常定义默认的异常处理页面,exceptionMappings未定义的异常使用本默认配置 -->
	<property name="defaultErrerView" value="errer"></property>
     <!-- 定义异常处理页面用来获取异常信息的变量名,默认名为exception -->
	<property name="exceptionAttribute" value="ex"></property>
     <!--
    定义需要特殊处理的异常,用类名或完全路径名作为key,异常页文件名作为值,
    将不同的异常映射到不同的页面上。
 -->
	<property name="exceptionMappings">
		<props>
			<prop key="IOException">errer/ioexp</prop>
			<prop key="org.springframework.jdbc.BadSqlGrammarException">errer/sqlexp</prop>
			<prop key="org.apache.shiro.authz.UnauthorizedException">errer/403</prop>
		</props>
	</property>
</bean>