I'm googling but I find difficulties in finding translate for the strings to pass to the config.getServletContext().getAttribute() method in the next two lines. These lines are from an application deployed on WAS 8.5.
String applicationName = (String)config.getServletContext().getAttribute("com.ibm.websphere.servlet.enterprise.application.name");
String serverName = (String)config.getServletContext().getAttribute("com.ibm.websphere.servlet.application.host");
I'm working/studying now on WAS Liberty.
Maybe would be even better a link to a reference for all the possible attributes for Liberty (if exists...)
EDIT
Sorry, I could not test it before because other errors in application blocking the execution, but it turns that those strings to pass to getAttribute method are valid even on my local Liberty test server, so:
String applicationName = (String)config.getServletContext().getAttribute("com.ibm.websphere.servlet.enterprise.application.name");
String serverName = (String)config.getServletContext().getAttribute("com.ibm.websphere.servlet.application.host");
is valid on WebSphere 8.5 and ALSO on Liberty.
@Andy Guibert methods are also ok to retrieve AppName and HostName, even in more general manner.
Anyway I'd like to go deeper in this topic, and I'd like to find documentation on which are all the possible strings I could pass to (String)config.getServletContext().getAttribute("") in order to retrieve information in a IBM environment, especially Liberty (if there is any difference against classic Websphere)...
But I can't find it...