Get Java application server name and version

前端 未结 3 1901
生来不讨喜
生来不讨喜 2020-12-14 16:43

I am writing a Web application with Java, and this WAR application may be deployed to different application servers, such as Tomcat/JBoss/Jetty/Weblogic.

For diagnos

3条回答
  •  旧时难觅i
    2020-12-14 17:16

    I have find some code for getting server information of where you deploy your application.
    This code is written in Servlet to get server info in which it is running..

    String str1 = getServletContext().getServerInfo();

    By this you will get the server name and the server's version info.

    I think it will some what help you..

提交回复
热议问题