摘要: 在MyBatis-Plus中,分页功能通常是通过配置MybatisPlusInterceptor(或其前身PaginationInterceptor)来实现的,这是一个全局的拦截器,用于拦截MyBatis的SQL执行,并在其中添加分页逻辑。以下是一个使用MybatisPlusInterceptor进 阅读全文
posted @ 2024-07-25 10:34 文采杰出 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 具体来说,table-underline 的含义是: 当 table-underline 设置为 true 时: 假设你有一个实体类名为 UserInfo,那么 MyBatis-Plus 会默认去数据库中寻找名为 user_info 的表(即,驼峰命名法自动转换为下划线命名法)。 同理,如果你的数据 阅读全文
posted @ 2024-07-24 11:09 文采杰出 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 在Java编程中,特别是在使用MyBatis或MyBatis-Plus这样的ORM(对象关系映射)框架时,@Mapper是一个常见的注解,用于标记接口为MyBatis的Mapper接口。Mapper接口是MyBatis中用于操作数据库的核心接口,它定义了与数据库表交互的方法。 下面我将简要介绍@Ma 阅读全文
posted @ 2024-07-24 07:46 文采杰出 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 当你看到@SpringBootTest注解以及其中的@BootstrapWith和@ExtendWith元注解时,这是与Spring Boot和JUnit 5集成相关的内容。解释如下: @SpringBootTest @SpringBootTest是Spring Boot提供的一个注解,用于加载Sp 阅读全文
posted @ 2024-07-24 00:23 文采杰出 阅读(1) 评论(0) 推荐(0) 编辑
摘要: @SpringBootApplication 和 @SpringBootConfiguration 是 Spring Boot 框架中用于简化配置的两个重要注解。它们之间的关系和各自的作用如下: @SpringBootConfiguration @SpringBootConfiguration 注解 阅读全文
posted @ 2024-07-24 00:22 文采杰出 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 首先编写相当于web.xml的配置类 package com.powernode.springmvc.config; import jakarta.servlet.Filter; import org.springframework.context.annotation.Configuration; 阅读全文
posted @ 2024-07-19 10:02 文采杰出 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 在Spring MVC中,public interface View 和 public interface ViewResolver 是两个相互关联但功能不同的接口。它们共同在视图解析和渲染过程中发挥作用,但各自承担的责任不同。 View 接口 View 接口定义了如何渲染一个特定的视图。它通常包含 阅读全文
posted @ 2024-07-18 08:47 文采杰出 阅读(3) 评论(0) 推荐(0) 编辑
摘要: Spring MVC在处理器方法执行过程中出现了异常,可以采用异常处理器进行应对。 一句话概括异常处理器作用:处理器方法执行过程中出现了异常,跳转到对应的视图,在视图上展示友好信息。 配置ExceptionController package com.powernode.springmvc.cont 阅读全文
posted @ 2024-07-13 23:08 文采杰出 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 使用SpringMVC6版本,不需要添加以下依赖: <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.5</version> </depe 阅读全文
posted @ 2024-07-12 23:53 文采杰出 阅读(4) 评论(0) 推荐(0) 编辑
摘要: mvc:annotation-driven/ 是 Spring MVC 中的一个配置元素,它用于简化和加速 Spring MVC 应用的配置,尤其是那些使用注解的控制器。当你在 Spring MVC 配置文件中添加了 mvc:annotation-driven/ 元素时,Spring 会自动注册一系 阅读全文
posted @ 2024-07-08 10:20 文采杰出 阅读(5) 评论(0) 推荐(0) 编辑