<?xml version=”1.0” encoding=”UTF-8”?>

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">

<!– 处理器映射器–>
<bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<!– 处理器适配器–>
<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"/>

<!--自动扫描包,让指定包下的注解生效,有IOC容器统一管理-->
<context:component-scan base-package="com.jiang.controller"/>
<mvc:annotation-driven/>
<mvc:default-servlet-handler/>

<!-- 视图解析器-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" id="internalResourceViewResolver">

<!-- 前缀-->
<property name="prefix" value="/WEB-INF/jsp/"/>
<!-- 后缀-->
<property name="suffix" value=".jsp"/>
</bean>
</beans>

posted on 2022-07-12 10:23  山与月  阅读(86)  评论(0编辑  收藏  举报