wangcaitao-global-exception-handler

spring boot 统一异常处理

License

License

GroupId

GroupId

cn.wangcaitao
ArtifactId

ArtifactId

wangcaitao-global-exception-handler
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

wangcaitao-global-exception-handler
spring boot 统一异常处理
Source Code Management

Source Code Management

https://github.com/wangcaitao/wangcaitao-global-exception-handler

Download wangcaitao-global-exception-handler

How to add to project

<!-- https://jarcasting.com/artifacts/cn.wangcaitao/wangcaitao-global-exception-handler/ -->
<dependency>
    <groupId>cn.wangcaitao</groupId>
    <artifactId>wangcaitao-global-exception-handler</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/cn.wangcaitao/wangcaitao-global-exception-handler/
implementation 'cn.wangcaitao:wangcaitao-global-exception-handler:1.0.1'
// https://jarcasting.com/artifacts/cn.wangcaitao/wangcaitao-global-exception-handler/
implementation ("cn.wangcaitao:wangcaitao-global-exception-handler:1.0.1")
'cn.wangcaitao:wangcaitao-global-exception-handler:jar:1.0.1'
<dependency org="cn.wangcaitao" name="wangcaitao-global-exception-handler" rev="1.0.1">
  <artifact name="wangcaitao-global-exception-handler" type="jar" />
</dependency>
@Grapes(
@Grab(group='cn.wangcaitao', module='wangcaitao-global-exception-handler', version='1.0.1')
)
libraryDependencies += "cn.wangcaitao" % "wangcaitao-global-exception-handler" % "1.0.1"
[cn.wangcaitao/wangcaitao-global-exception-handler "1.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
cn.wangcaitao : wangcaitao-common jar
org.springframework : spring-webmvc jar
org.springframework.security : spring-security-core jar

provided (1)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 3.1.0

Project Modules

There are no modules declared in this project.

wangcaitao-global-exception-handler

spring boot 统一异常处理

使用

  1. 添加依赖

    <dependency>
        <groupId>com.wangcaitao</groupId>
        <artifactId>wangcaitao-global-exception-handler</artifactId>
        <version>2.1.3</version>
    </dependency>
  2. 配置文件

    spring:
      mvc:
        throw-exception-if-no-handler-found: true
      resources:
        add-mappings: false
  3. @SpringBootApplication 修改为 @SpringBootApplication(scanBasePackages = {"com.wangcaitao.global", "com.xxx.xxx"}), com.xxx.xxx 为启动类所在 package

Versions

Version
1.0.1
1.0.0