如何在使用struts的时候修改了东东,不重启服务器(两种方法,见下文)
Some applications might require the ability to reload the Struts configuration files without restarting the web container. If your application is one of them, there are ways you can do this. One approach is to create a Struts action that will reinitialize the ActionServlet (you may want to restrict which users can call this action). Once the ActionServlet is reinitialized, everything will be new and the application can again service requests, just like before. A second strategy is to create a thread that monitors the lastModifiedTime of the configuration file. It can sleep for a few seconds and, upon awakening, compare the lastModifiedTime of the file against the one stored in a variable. If they are different, the file has changed and it's time to reload the application. This approach is nice because you don't have to worry about an unwelcome user reloading your application. However, the time that it gets reloaded is entirely up to the thread.