摘要: GET请求传递普通参数 原因:tomcat 8.5版本之后GET请求就不再出现中文乱码问题,但是我们使用的是tomcat7插件,所以会出现GET请求中文乱码问题。 解决:在pom.xml添加tomcat7插件处配置UTF-8字符集,解决GET请求中文乱码问题。 <build> <plugins> < 阅读全文
posted @ 2022-06-30 14:27 happyZHF 阅读(56) 评论(0) 推荐(0)
摘要: Controller加载控制与业务bean加载控制 SpringMVC相关bean(表现层bean) Spring控制的bean 业务bean(Service) 功能bean(DataSource等) SpringMVC相关bean加载控制 SpringMVC加载的bean对应的包均在com.ith 阅读全文
posted @ 2022-06-30 14:01 happyZHF 阅读(165) 评论(0) 推荐(0)
摘要: 1、实现步骤 1 创建web工程(Maven结构)2 设置tomcat服务器,加载web工程(tomcat插件)3 导入坐标(SpringMVC+Servlet)4 定义处理请求的功能类(UserController)5 编写SpringMVC配置类,加载处理请求的Bean。6 加载SpringMV 阅读全文
posted @ 2022-06-30 12:19 happyZHF 阅读(42) 评论(0) 推荐(0)
摘要: 【前置工作】环境准备 Spring整合Mybatis相关代码(依赖、JdbcConfig、MybatisConfig、SpringConfig)省略。 public interface AccountDao { @Update("update tbl_account set money = mone 阅读全文
posted @ 2022-06-29 14:52 happyZHF 阅读(57) 评论(0) 推荐(0)
摘要: 1 前置通知 名称:@Before 类型:方法注解 位置:通知方法定义上方 作用:设置当前通知方法与切入点之间的绑定关系,当前通知方法在原始切入点方法前运行 范例: @Before("pt()") public void before() { System.out.println("before a 阅读全文
posted @ 2022-06-29 10:06 happyZHF 阅读(81) 评论(0) 推荐(0)
摘要: 【第一步】导入aop相关坐标 <dependencies> <!--spring核心依赖,会将spring-aop传递进来--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artif 阅读全文
posted @ 2022-06-29 09:49 happyZHF 阅读(39) 评论(0) 推荐(0)
摘要: 【第一步】导入整合的依赖坐标spring-test <!--junit--> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> <!-- 阅读全文
posted @ 2022-06-28 14:18 happyZHF 阅读(91) 评论(0) 推荐(0)
摘要: 1 思路分析 1.1 MyBatis程序核心对象分析 1.2 整合MyBatis 使用SqlSessionFactoryBean封装SqlSessionFactory需要的环境信息 使用MapperScannerConfigurer加载Dao接口,创建代理对象保存到IOC容器中 2 代码实现 2.1 阅读全文
posted @ 2022-06-28 14:11 happyZHF 阅读(39) 评论(0) 推荐(0)
摘要: 在pom.xml 文件中添加 <build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</in 阅读全文
posted @ 2022-06-28 10:35 happyZHF 阅读(120) 评论(0) 推荐(0)
摘要: 【第一步】在applicationContext.xml中开启Spring注解包扫描 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:con 阅读全文
posted @ 2022-06-28 09:15 happyZHF 阅读(41) 评论(0) 推荐(0)