Reloading resources loaded by getResourceAsStream

后端 未结 3 1687
無奈伤痛
無奈伤痛 2021-02-13 23:44

Following best practices, I\'m using Thread.currentThread().getContextClassLoader().getResourceAsStream to load resources in a web application (like text files or x

3条回答
  •  野性不改
    2021-02-14 00:21

    In addition to kschneid's answer which might work for Tomcat indeed, I wanted to add that for JBoss AS 5+ it already seems to work without needing any special tricks.

    Caching of resources is probably class loader specific. The JBoss AS one either doesn't cache or is smart enough to see that the resource on disk has changed.

提交回复
热议问题