简体   繁体   English

如何在运行时获取 Springboot 应用的 WebApplicationType?

[英]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.我有一个库,可用于反应式和非反应式 spring-boot 应用程序。 How can I within my library find out at runtime whether the application is REACTIVE or SERVLET?如何在我的库中在运行时找出应用程序是 REACTIVE 还是 SERVLET?

You can use Java decompiler, such as可以使用Java反编译器,比如

You will see something like this你会看到这样的东西

在此处输入图像描述

(source: http://java-decompiler.github.io/ ) (来源: 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.如果你看到像https://projectreactor.io/docs/core/release/api/这样的类,那么它就是 Spring Boot Reactor 项目,反之亦然。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Springboot 应用程序中获取 HTTPServletRequest - How do I get the HTTPServletRequest in Springboot application 如何在运行时更新SpringBoot应用程序的配置,而无需重新加载整个ApplicationContext - How to update configuration of SpringBoot application at runtime without reloading whole ApplicationContext Springboot 获取如果字段在运行时可以为空 - Springboot Get if field is nullable on runtime 如何获取springboot应用程序资源中所有扩展名为xml的文件? - How to get all files with xml extension placed in resources of springboot application? 如何在运行时获取Java应用程序的真实路径? - How to get the real path of Java application at runtime? 如何加载外部属性文件并覆盖springboot application.properties(没有运行时参数)? - How to load external properties file and override springboot application.properties (without runtime args)? 如何获取运行时Web应用程序路径? - How to get Runtime Web Application path? 如何在Weblogic应用服务器上部署SpringBoot应用程序? - How to deploy SpringBoot Application on Weblogic application server? 如何在 springboot 应用程序中管理更新 - How to manage updates in a springboot application 如何设置监视器以获取Java应用程序的运行时消息 - How to set a monitor to get the runtime message of a Java application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM