文章分类 -  Maven 学习笔记

摘要:一、时代背景 1. 微服务 微服务是一种架构风格 一个应用拆分为一组小型服务 每个服务运行在自己的进程内,也就是可独立部署和升级 服务之间使用轻量级HTTP交互 服务围绕业务功能拆分 可以由全自动部署机制独立部署 去中心化,服务自治,服务可以使用不同的语言,不同的存储技术**(微服务是一种架构风格, 阅读全文
posted @ 2022-12-04 12:09 君子键 阅读(22) 评论(0) 推荐(0) 编辑
摘要:1. 补充的地方 1.1 Transactional service 类中增加事务注解 package com.atguigu.imperial.court.service.impl; import com.atguigu.imperial.court.entity.Emp; import com. 阅读全文
posted @ 2022-12-03 20:16 君子键 阅读(16) 评论(0) 推荐(0) 编辑
摘要:1. component 模块中增加 controller 和 service 1.1 AuthController package com.atguigu.imperial.court.controller; import com.atguigu.imperial.court.entity.Emp 阅读全文
posted @ 2022-12-03 19:58 君子键 阅读(34) 评论(0) 推荐(0) 编辑
摘要:1. util 模块中增加类 package com.atguigu.imperial.court.exception; public class LoginFailedException extends RuntimeException { public LoginFailedException( 阅读全文
posted @ 2022-12-03 17:33 君子键 阅读(15) 评论(0) 推荐(0) 编辑
摘要:1. resources 目录下增加 spring-mvc.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http:// 阅读全文
posted @ 2022-12-03 17:09 君子键 阅读(16) 评论(0) 推荐(0) 编辑
摘要:增加 tx 的命名空间和配置事务 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/X 阅读全文
posted @ 2022-12-03 14:49 君子键 阅读(14) 评论(0) 推荐(0) 编辑
摘要:1. 增加mybatis配置 命名空间加上 mybatis,配置 SqlSessionFactoryBean 和 mybatis 接口的扫描 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework 阅读全文
posted @ 2022-12-03 14:17 君子键 阅读(16) 评论(0) 推荐(0) 编辑
摘要:1. 添加配置文件和测试类 driverClassName=com.mysql.cj.jdbc.Driver url=jdbc:mysql://localhost:3306/db_imperial_court dev.username=root password=root initialSize=1 阅读全文
posted @ 2022-12-03 13:45 君子键 阅读(15) 评论(0) 推荐(0) 编辑
摘要:使用 mybatis 的逆向工程生成代码 1. 增加配置文件 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator 阅读全文
posted @ 2022-12-03 11:39 君子键 阅读(18) 评论(0) 推荐(0) 编辑
摘要:一. generate <dependencies> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.7</version> </dependency> </depen 阅读全文
posted @ 2022-11-13 22:46 君子键 阅读(20) 评论(0) 推荐(0) 编辑
摘要:一. 创建工程 1. 父工程 2. web 模块 2.1 创建 2.2 修改 packaging <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=" 阅读全文
posted @ 2022-11-13 11:52 君子键 阅读(31) 评论(0) 推荐(0) 编辑
摘要:1. 适配部署环境 MySQL 连接信息中,IP 地址部分需要改成 localhost url=jdbc:mysql://localhost:3306/db_imperial_court 2. 跳过测试打包 mvn clean package -Dmaven.test.skip=true 可以人为指 阅读全文
posted @ 2022-11-01 23:07 君子键 阅读(12) 评论(0) 推荐(0) 编辑
摘要:1. 增加过滤器 LoginFilter package com.atguigu.imperial.court.filter; import com.atguigu.imperial.court.util.ImperialCourtConstant; import javax.servlet.*; 阅读全文
posted @ 2022-10-31 23:16 君子键 阅读(20) 评论(0) 推荐(0) 编辑
摘要:1. MemorialsDao 和 MemorialsDaoImpl package com.atguigu.imperial.court.dao.api; import com.atguigu.imperial.court.entity.Memorials; import java.util.Li 阅读全文
posted @ 2022-10-30 21:57 君子键 阅读(21) 评论(0) 推荐(0) 编辑
摘要:1. MemorialsDao 增加方法 selectAllMemorialsDigest package com.atguigu.imperial.court.dao.api; import com.atguigu.imperial.court.entity.Memorials; import j 阅读全文
posted @ 2022-10-30 18:11 君子键 阅读(21) 评论(0) 推荐(0) 编辑
摘要:1. EmpDao 增加方法 selectEmpByLoginAccount package com.atguigu.imperial.court.dao.api; import com.atguigu.imperial.court.entity.Emp; public interface EmpD 阅读全文
posted @ 2022-10-30 11:04 君子键 阅读(24) 评论(0) 推荐(0) 编辑
摘要:1. 首页 Servlet package com.atguigu.imperial.court.servlet.module; import com.atguigu.imperial.court.servlet.base.ViewBaseServlet; import javax.servlet. 阅读全文
posted @ 2022-10-23 21:12 君子键 阅读(19) 评论(0) 推荐(0) 编辑
摘要:1. 常量 package com.atguigu.imperial.court.util; public class ImperialCourtConstant { public static final String LOGIN_FAILED_MESSAGE = "账号、密码错误,不可进宫!"; 阅读全文
posted @ 2022-10-23 17:14 君子键 阅读(24) 评论(0) 推荐(0) 编辑
摘要:1. 修改 thymeleaf 版本号 开始导入的版本不能用,没有 ServletContextTemplateResolver <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf</artifactId> <ver 阅读全文
posted @ 2022-10-23 16:39 君子键 阅读(27) 评论(0) 推荐(0) 编辑
摘要:1. 添加 filter 类 package com.atguigu.imperial.court.filter; import com.atguigu.imperial.court.util.JDBCUtils; import javax.servlet.*; import javax.servl 阅读全文
posted @ 2022-10-23 14:38 君子键 阅读(30) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示