博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
spring-mvc xml文件的最基本配置
阅读量:4681 次
发布时间:2019-06-09

本文共 935 字,大约阅读时间需要 3 分钟。

<?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"
    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/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">
    <mvc:annotation-driven />
    <context:component-scan base-package="com.exyong" />
</beans>
注意配置中的拼写错误,我在配置的时候 <beans xmlns   漏了个s (xmln)导致一直报 “cvc-elt.1: 找不到元素 'beans' 的声明”

注意  <mvc:annotation-driven />配置的base-package 的值为放置Controller的包名,否则报 “No mapping found for HTTP request with URI“

转载于:https://www.cnblogs.com/exayong/p/6158846.html

你可能感兴趣的文章
国际化问题简述
查看>>
poj2975 Nim
查看>>
.NET面试题系列(十四)锁
查看>>
一个使用 Go 的思维来帮助您构建并开发 Go 应用程序的开源框架
查看>>
.Net并行编程之同步机制
查看>>
iis 站点部署后 Microsof .Net Framework异常
查看>>
解决安全扫描Insecure HTTP Methods Enabled的问题
查看>>
使用jQuery验证用户名是否存在,达到局部刷新的效果
查看>>
团队-学生成绩管理一阶段互评
查看>>
mongodb安装和使用
查看>>
C++Primer笔记-----day01
查看>>
MSSQL 各个发行版本版本号以及Compact 版本号(更新)
查看>>
tslint.json的配置项说明
查看>>
iKcamp|基于Koa2搭建Node.js实战(含视频)☞ 代码分层
查看>>
C# 优化程序的四十七种方法
查看>>
Manacher算法——最长回文子串(O(n))
查看>>
web开发如何使用高德地图API(二)结合输入提示和POI搜索插件
查看>>
hdu 4349 Xiao Ming's Hope lucas
查看>>
Asp.net下载功能的解决方案代码
查看>>
linux积累
查看>>