读书人

程序中判断应用服务器部类

发布时间: 2012-08-31 12:55:03 作者: rapoo

程序中判断应用服务器类型
在不同的应用服务器中,所用的相对路径有所不同,只有区分开所用的应用服务器,才能正确地应用的你路径。


Tomcat 与 weblogic 的区别
if(ServerDetector.isTomcat()){//tomcat server path = this.getServletContext().getRealPath("/")+"data\\"+userId+".xls";}else if(ServerDetector.isWebLogic()){//weblogic server path = this.getServletContext().getRealPath("/")  +"\\data\\"+userId+".xls";}

读书人网 >应用服务器

热点推荐