1.导包
官网:http://spring.io/
下载地址:http://repo.springsource.org/libs-release-local/org/springframework/spring解压:(Spring目录结构:)
* docs :API和开发规范.
* libs :jar包和源码.
* schema :约束.
日志包:日志规范包和日志包(log4j)
log4j配置文件 //最后一行info改为off log语句将不会输出 放在src下
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.err
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### direct messages to file mylog.log ###
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=c\:mylog.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### set log levels - for more verbose logging change 'info' to 'debug' ###
log4j.rootLogger=info, stdout
2.配置applicationContext.xml文件在src下 bean表示要创建的类对象 id随意 class为该类的全类名