<?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:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
这么长,应该不是程序猿手写的吧,如果不是手写的,那一般情况下都是如何写这个头文件的?
每次手写当然不可能,也没必要,在eclipse/myeclipse中创建会自动生成如上的xml(模板)。
其实在初学时,都要求手写,目的是为了理解xml每个配置节点的含义。
eclipse新建,里面有模板,xml文件都会在开头定义使用的scheme,scheme是检验一个xml是否格式正确的依据。这里还定义了命名空间beans
这样,下面可以用 beans:xxx 来表示它的属性