ssJ框架搭建的流程
ssj框架:
spring springmvc springdatajpa
框架基本认识:
spring:
一个轻量级的ioc和aop的容器框架
ioc:反转控制,依赖注入,就是将创建管理bean的事情交个spring来做,我们只需要在使用时注入
aop:面向切面编程就是按条件拦截,加入相应的功能,例如权限验证就是这个原理
springmvc:
springmvc就是做servlet的事情,与spring无缝连接
springdatajpa:
就是对于又一层jpa的封装,底层还是基于实现jpa(规范)的hibernate技术(标准的orm对象关系映射框架)
1.首先配置spring
1.引入头
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
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.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context
/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-
tx.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd=">
2.扫描配置注解的包
<context:component-scan base-package="cn.itsource.aidell.service"/>
3.引入jdbc文件
<context:property-placeholder location="classpath:jdbc.properties"/>
4.<!--连接池-->
<bean name="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name&#