<?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:context="http://www.springframework.org/schema/context" 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-4.0.xsd"> <!-- 配置自定义扫描包 --> <context:component-scan base-package="Handlers"></context:component-scan> <!-- 映射物理路径 --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/Views/"></property> <property name="suffix" value=".jsp"></property> </bean> </beans>
idea 创建 springMVC 项目中 dispatcher-servlet.xml文件的基本配置
最新推荐文章于 2023-05-13 16:35:25 发布
本文详细介绍了 Spring MVC 的配置过程,包括自定义扫描包的设置及视图解析器的配置,通过具体的 XML 示例展示了如何指定组件扫描的基本包路径以及如何配置内部资源视图解析器的前缀和后缀。
6697

被折叠的 条评论
为什么被折叠?



