zoukankan      html  css  js  c++  java
  • spring-mvc xml文件的最基本配置

    <?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“

  • 相关阅读:
    常用JVM配置参数
    JVM运行机制
    go 奇技淫巧
    如何实现LRU(最近最少使用)缓存淘汰算法?
    数组下标为什么是0而不是1?
    ServiceMesh 演化进程
    CAP定理详解
    vscode 调试配置信息
    Ubuntu 断网问题解决
    ubuntu 关闭指定占用端口
  • 原文地址:https://www.cnblogs.com/exayong/p/6158846.html
Copyright © 2011-2022 走看看