spring/springmvc.xml

(完整代码) 2KB

<?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:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
   	xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="
    	http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
    	http://www.springframework.org/schema/mvc  http://www.springframework.org/schema/mvc/spring-mvc.xsd
   		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
    	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
   
    <aop:aspectj-autoproxy proxy-target-class="true"></aop:aspectj-autoproxy>
   
    <!-- 配置组件扫描 -->
    <context:component-scan base-package="com.yh.controller"></context:component-scan>
    
    <!-- 注解驱动加载   自动加载RequestMappingHandlerMapping和RequestMappingHandlerAdapter-->
    <mvc:annotation-driven conversion-service="conversionService"></mvc:annotation-driven>
   
    <!-- 配置转换器 -->
    <bean id="conversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
   		<property name="converters">
   			<list>
   				<bean class="com.yh.conversion.DateConverter"></bean>
   			</list>
   		</property>
    </bean>
   
    <!-- 放行 -->
 	<mvc:resources mapping="/css/**" location="/css/"/>	
 	<mvc:resources mapping="/images/**" location="/images/"/>
 	<mvc:resources mapping="/js/**" location="/js/"/>
   
    <!-- 配置异常处理器 -->
    <bean name="myExceptionHandler" class="com.yh.exception.MyExceptionHandler"/>  
   
	<!-- 配置视图解析图 -->
	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<!-- 配制逻辑视图的前缀 -->
		<!-- <property name="prefix" value="/jsp/"></property> -->
		<!-- 配制逻辑视图的后缀 -->
		<property name="suffix" value=".jsp"></property>
	</bean>
	
	<!-- 配置拦截器 -->
 	<mvc:interceptors>
 		<mvc:interceptor>
 			<!-- 所有请求都进入拦截器 -->
 			<mvc:mapping path="/**"/>
 			<!-- 配置具体的拦截器类 -->
 			<bean class="com.yh.interceptor.MyHandlerInterceptor"></bean>
 		</mvc:interceptor>
 	</mvc:interceptors>
 	

</beans>    

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。