简体   繁体   English

如何确定Weblogic Server的当前版本

[英]How can I identify the current version of Weblogic Server

I have a situation where the same lines of code must run on both Weblogic 11g (10.3.5) and Weblogic 12. This is while we (slowly) work on upgrading. 我遇到的情况是,在Weblogic 11g(10.3.5)和Weblogic 12上都必须运行相同的代码行。这是我们(缓慢地)进行升级的时候。

Unfortunately, Weblogic 11 seems not to set a certain request attribute properly (FORWARD_QUERY_STRING), so I need a slightly different set of instructions to perform a certain task. 不幸的是,Weblogic 11似乎没有正确设置某些请求属性(FORWARD_QUERY_STRING),因此我需要一组稍有不同的指令来执行某些任务。 The WLS 11 version throws an exception on WLS 12, and vice versa. WLS 11版本在WLS 12上引发异常,反之亦然。

My question is: is there a way that, at runtime, I can identify the Weblogic version, and so run the appropriate lines? 我的问题是:有没有一种方法可以在运行时识别Weblogic版本并运行相应的行?

ServletContext.getServerInfo() will tell server information on which it is running. ServletContext.getServerInfo()将告诉服务器正在其上运行的信息。

References: 参考文献:

ServletContext.getServerInfo() ServletContext.getServerInfo()

We set environment variables for our various WebLogic servers so that runtime code can react to the specific version. 我们为各种WebLogic服务器设置了环境变量,以便运行时代码可以对特定版本做出反应。 Set this variable in the server startup script. 在服务器启动脚本中设置此变量。

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

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