Tomcat display name

Trying to change the web.xml (/opt/Interwoven/LiveSiteDisplayServices/runtime/web/WEB-INF/web.xml) displayname and I want to have it read a bean/property from LOCAL-INF


Background:  LSDS732,  we have a number (20+) sites with different docroots but share assets & WEB-INF, so when we look through our management tool, we see a bunch of apps named LiveSite Runtime, but I would like to get some unique indentifer. 


I thought I could create a bean in LOCAL-INF/customizations.xml, which I include in web.xml.  That works and other beans show up,  but how can I change this to read a bean value:


<web-app id="livesite-runtime">
<display-name>LiveSite Runtime</display-name>


  • You won't be able to, at least not through configs alone. This config is loaded before spring, so it doesn't have access to its information. There *might* be a Tomcat-specific API, whereby you could have a Spring-configured class with an init-method, and that class would call the TomcatAPI to say webappContext.setDisplayName().. but if such an API exists, I haven't seen it.


    EDIT: There's a few ways to get the ServletContext object. Best way would be to create a custom ContextLoaderListener. The ServletContext has a getServletContextName() which probably returns the display-name from your web.xml. Perhaps if you can cast this to whatever container-specific implementation class, it might have a setter method as well. Feels like that property should be read-only though.

  • Thanks  that was what I was seeing as well. I was hoping that there would be something I missed. 



Sign In or Register to comment.