Java FileChangedLoadingStrategy不反映在application.properties文件中所做的更改,而不重新启动服务器
我在JBossServer7上使用SpringMVC,我在谷歌上搜索并找到了以下代码Java FileChangedLoadingStrategy不反映在application.properties文件中所做的更改,而不重新启动服务器,java,spring,jboss,Java,Spring,Jboss,我在JBossServer7上使用SpringMVC,我在谷歌上搜索并找到了以下代码 Resource resource = new ClassPathResource("application.properties"); final PropertiesConfiguration property = new PropertiesConfiguration(resource.getURL()); //set the reloading strategy property
Resource resource = new ClassPathResource("application.properties");
final PropertiesConfiguration property = new PropertiesConfiguration(resource.getURL());
//set the reloading strategy
property.setReloadingStrategy(new FileChangedReloadingStrategy());
我的要求是,每当我在application.properties文件中进行任何更改时,都必须在应用程序中反映出来,而无需重新启动服务器。我正在使用JBoss7服务器。在war文件中,我在类文件夹中有application.properties文件,如果我在该文件中做了任何更改,并且在刷新时,更改必须反映在我的应用程序中
我在谷歌上搜索了一下,找到了上面的代码,但它无法立即进行更改和刷新当前代码仅反映在重新启动服务器时。
这是正确的使用方法还是对我的要求有什么建议?
请帮忙