How to get the Application name/fullpath in a servlet deployed in WebLogic
Just like we can get the domain root directory from weblogic.management.DomainDir
String root = DomainDir.getRootDir() ;
and domain n开发者_JAVA百科ame from weblogic.management.configuration.DomainMBean
DomainMBean domainMBean = MBeanUtils.getDomainMBean();
String domainName = domainMBean.getName() ;
How can i get , the application name in which the servlet is deployed from inside the same servlet ? Which API from weblogic provides that information ?
for eg : application path = Middleware/user_projects/domains/Domain_1/servers/AdminServer/upload/webapp1. war
and application name = webapp1. war
Edited by: Tom on Mar 31, 2011 7:27 PM
I dont have a working example to hand, but try
getComponentName()
and getModuleURI()
from the
weblogic.management.runtime.WebAppComponentRuntimeMBean
精彩评论