I’ve a tomcat (with JSF) application. I want to know the path of the war of the current application.
I’ve tried the following code to know where tomcat is
((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext()).getRealPath("")
However, after I add antiResourceLocking="true" to the context definition, the previous command is returning a temporal directory.
I’ve been debugging, and I see that in the
((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext())
There is a variable named context with one attribute named docBase, which contains the info that I need. However I can’t get this by any way.
The reason of this is: I’m doing an auto-update system, so I need to get the current war in order to apply some patches to it. Therefore I need the current war file path.
Either it is not possible, or no one knows how to resolve this.