Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
556 views
in Technique[技术] by (71.8m points)

servlets - Get Java application server name and version

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 diagnostic purpose, I'd like to implement a dynamic web page to collect various environment/system information so that customer can provide these information to support engineers for diagnostics.

One piece of information that is useful is the application server name and version that this application gets deployed to, such as Tomcat 7.0, JBoss 5.1.0, Glassfish 3.0, etc.

I just wonder if there is any standard way to retrieve application server's name and version from different JEE application servers.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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..


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...