I have an EAR application in a cell with two web modules, each web module has a servlet.
I want to get through JNDI the application and module name when I request each servlet.
I have tried with:
String applicationName = (String) new InitialContext()
.lookup("java:app/AppName");
String moduleName = (String) new InitialContext()
.lookup("java:module/ModuleName");
Did't work. app and module are not found in java: .
I found this example in a webpage, maybe this works for WebSphere 8 but not for 7.
I tried to found an entry with the app or module name in java:comp/env but I didn't found any.
- How could I get the application name from the Application Server ?
- And the module name ?
- There is a better way than though JNDI ?
Thanks in advance.