码迷,mamicode.com
首页 > 编程语言 > 详细

spring配置文件介绍

时间:2018-07-16 14:14:10      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:context   mvc   固定   cas   spring配置   frame   xmlns   com   ack   

spring的配置文件比较固定,这里以springmvc的配置文件为例介绍,beans是根标签,xmlns是name space的简称,一般xmlns有beansXMLSchema-instancemvccontext

、tx。xml中用到什么标签必须要在xmlns中注明。下面的schemaLocation地址是上面声明所要遵守的规范。

<?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"
      xmlns:context="http://www.springframework.org/schema/context"
        
      xsi:schemaLocation="
      http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    
      http://www.springframework.org/schema/mvc
      http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
        
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context-3.0.xsd
      ">
    
    <!-- 将带有注解的类加入到spring容器中 -->
    <context:component-scan base-package="cn.itcast.javaee.springmvc.app15"/>
    
</beans>      

 

spring配置文件介绍

标签:context   mvc   固定   cas   spring配置   frame   xmlns   com   ack   

原文地址:https://www.cnblogs.com/wangxiaochao/p/9317152.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!