ssm框架: Spring+SpringMVC+MyBatis
IDEA搭建项目:https://blog.csdn.net/weixin_42768559/article/details/84634585
mybatis generator生成 dao,model,sqlmap包中文件
项目配置 pom.xml 导入jar包
mybatis配置 resources下的jdbc.properties、generator.properties、log4j.properties 配置文件:generatorCongif.xml
spring配置 resources下spring下 配置文件:applicationContext.xml
在sqlmap下的 *Mapper.xml中创建测试类 Alt+Enter
junit Test
SpringMVC配置 resources下spring下spring-mvc.xml 新建后加入Project Struturs —— Moudules —— Spring
编辑 webapp/WEB-INF/web.xml
点击Edit Configrations...去配置tomcat
点击左上角的加号,找到Tomcat Server 选择Local(如果没有,可以点击下面的items more找到)
Server页配置没问题的话点击 Deployement,点击右侧加号,选择Artigact...
run tomcat
问题收集:
解决JDBC连接MySQL时发出的警告WARN: Establishing SSL connection without server's identity verification ...
Error creating bean with name 'sqlSessionFactory' defined in URL
Invalid bound statement (not found)---