第一篇博客,spring配置文件
来源:互联网 发布:中银证券交易软件 编辑:程序博客网 时间:2024/05/16 05:35
以前自己学习的时候搭建过SSH框架,但是现在到公司了工作了那么久,很多东西都忘记了,而且当时习惯不好,没有做笔记,所有现在有空闲的时间,决定 写下博客,记录自己的学习过程,也为将来查找资料方便.
现在开始吧,最基础的,在eclipse里面新建一个maven项目, 进spring官网http://projects.spring.io/spring-framework/复制如下代码,直接拷贝到maven项目中的pom.xml文件中,
如图:
稍等一会儿,maven会直接把spring的jar包download下来,这只是核心的jar,如果需要其他的,还要到官网上面找,这里不再累述.
接下来,在resources文件夹下面新建一个xml文件,名称随便取,一般叫applicationContext.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:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:util="http://www.springframework.org/schema/util" xmlns:jpa="http://www.springframework.org/schema/data/jpa" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd"</beans>
具体的.xsd版本,根据你所依赖的jar包更改即可。
0 0
- 第一篇博客,spring配置文件
- 我的第一篇博客spring boot学习
- 第一篇博客日记
- 第一篇博客日志
- 第一篇博客文章
- 第一篇博客
- 第一篇博客文章
- 第一篇博客文章
- 第一篇博客
- 第一篇博客
- CSDN博客第一篇
- 我第一篇博客
- 开博客第一篇
- 第一篇博客
- 第一篇博客
- 第一篇博客
- 第一篇博客
- 第一篇博客
- Hive在spark2.0.0启动时无法访问../lib/spark-assembly-*.jar: 没有那个文件或目录的解决办法
- python将图片转换为字符画
- 数据库事务
- 设计模式学习(五)————装饰模式
- Tomcat(8080、8009、8005端口占用)无法启动问题解决
- 第一篇博客,spring配置文件
- NanoApe Loves Sequence(求最大值的期望)
- PV原语
- 关闭不断重启的进程
- Android官方开发文档Training系列课程中文版:电池续航时间优化之监测电池电量及充电状态
- μC/OS-II中的任务就绪表概述
- 数据归一化处理
- 文件存储之SQLite数据库存储
- JAVA的网络编程