I just have created a Java Filter that, if one of its properties has a true value, the filter will redirect all the requests to a maintenance JSP (the server is not operational). If that property has a false value, the filter will redirect to the right target. The filter reads the boolean value from a config.properties file. It's something like this:
// Read the file property
private static boolean MAINTENANCE = Boolean.parseBoolean(p.getProperty("maintenance"));
...
if(MAINTENANCE) {
redirectToURL("maintenance.jsp"); // maintenance JSP
}
else {
chain.doFilter(request, response); // requested jsp/servlet
}
...
The point is... If my Web is running and I want to put it in maintenance mode, how could I do to make the server reads the new value of that property from the file?
I mean: I connect to the server, edit the config file, set "maintenance" property to value equal to true... But, how can I do to make the web application read it?
Thanks!