您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
04-Spring练习-环境搭建实现3
发布时间:2025-01-06 22:46:00编辑:雪饮阅读()
-
继上篇,这里新增将上篇中空配置文件Spring mvc的配置文件中的beans中新增配置以及该配置文本beans标签自身添加mvc名称空间以及该名称空间对应的schemaLocation
其实这些配置前番都有学过的,这里就完整展示下配置之后的完整Spring mvc配置文件内容如:
<?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:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
">
<!--mvc注解驱动-->
<mvc:annotation-driven conversion-service="conversionService"/>
<!--配置内部资源视图解析器-->
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/pages/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
<!--静态资源权限开放-->
<mvc:default-servlet-handler/>
</beans>
关键字词:Spring