Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by Result CodeEnum.FAILED.getMessage
手把手带你上手swagger3 - Scotyzh - 博客园
只需要加一个依赖,并且要注意,swagger3在springboot2.5版本以上会出现问题 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version> </dependency> 如果高于2.5版本会报错: org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 解决方法是降低spring的版本到2.5.x以下,或者是降低swagger版本到3以下,或者是在SwaggerConfig注解上标注@EnableWebMvc 配置SwaggerConfig @Configuration @EnableSwagger2 @Slf4j...
springboot下添加全局异常处理和自定义异常处理 - Scotyzh - 博客园
前言 在spring项目中,优雅处理异常,好处是可以将系统产生的全部异常统一捕获处理,自定义的异常也由全局异常来捕获,如果涉及到validator参数校验器使用全局异常捕获也是较为方便。 相关代码: GlobalExceptionHandler类: @Slf4j @RestControllerAdvice public class GlobalExceptionHandler { /******************************** * @function : 自定义从捕捉 * @parameter : [e:CustomException | 自定义异常] * @date : 2023/12/5 11:47 ********************************/ @ExceptionHandler(value = CustomException.class) public AjaxResult customExceptionHandler(HttpServletRequest request, CustomException e) {...
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with Result
Contact Result, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack