System.getProperty(“catalina.base”) There can be scenario where client may use any other server

前端 未结 3 1097
情歌与酒
情歌与酒 2021-01-11 11:12

I am reading a properties file from the Tomcat\\conf\\somename.properties directory using

String demo = System.getProperty(\"catalina.base\") +         


        
3条回答
  •  太阳男子
    2021-01-11 11:21

    First use the ServletContext.getServerInfo() to determine the container. Then based on the container, use container specific ways of getting the information. For e.g. if the method returns "tomcat*" then you can use catalina.base thing, if it returns glassfish, then use some glassfish specific ways, and so on.

提交回复
热议问题