一、开发工具
1.Eclipse Java EE IDE for Web Developers.Version: 2018-09 (4.9.0)
2.Apache Tomcat v8.5
3.JDK 1.8
4.MySQL Server 5.7
二、整体结构
2.
3.
三、项目具体怎么做呢?
1.MYSQL数据库建库建表
①新建数据库,库名tab_ssm
②新建表,表名user
③user表中任意插入几条数据
至此数据库工作完成,下一步进入eclipse
2.eclipse
①new 一个 Dynamic web project 项目,自由起名,如 SSM_Demo
②按照’整体结构’中的三张图片分别在各个位置建.java、.xml、.jsp、.properties文件
3.文件源码-配置文件
①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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
<context:property-placeholder location="classpath:db.properties" />
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" /&g