Is there some way to find the path of tomcat's webapps directory using java, as we use System.getProperties("...")
to get user.dir
etc
thanks in advance.
In Java, for NIO Path, we can use path. toAbsolutePath() to get the file path; For legacy IO File, we can use file. getAbsolutePath() to get the file path.
The default appBase location is "$CATALINA_BASE/webapps", or "$CATALINA_HOME/webapps", if no base directory has been defined.
You can use System.getProperty( "catalina.base" )
for same. And add "/webapps"
to path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With