简体   繁体   中英

How to get the WebApplicationType of Springboot application at runtime?

I have a library that I use in reactive and non-reactive spring-boot applications. How can I within my library find out at runtime whether the application is REACTIVE or SERVLET?

You can use Java decompiler, such as

You will see something like this

在此处输入图像描述

(source: http://java-decompiler.github.io/ )

If you see these classes like https://projectreactor.io/docs/core/release/api/ then, it is Spring Boot Reactor project, and vice versace.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM