Siteswitch is a project mainly written in Java, it's free.
Demonstrates simple site component switches to allow a site to turn sections on and off verses the whole site on or off.
Site switches demonstrates how parts of your sites can be on or off. The point is to support being able to disable certain parts of your site while enabling others, verses a complete outage to your customers.
For example, if your search function on your site is failing and you still want to allow normal browser then why not just disable the search?
Uh... well I have this deployed on a tomcat install. It's not an "drop in" application at this point or library, but more so a example or concept. Since the implementation is so simple, it can be ported to anything.
The base implementation is done via simple resource bundle configuration to drive the switch states.
See: https://github.com/tepietrondi/siteswitch/blob/master/src/siteswitch/config/SwitchConfigurationReader.java
Look at: https://github.com/tepietrondi/siteswitch/blob/master/src/switchable/logic/LogicRunner.java
This runner looks to see if objects are runnable.
Look at: https://github.com/tepietrondi/siteswitch/blob/master/WebContent/SwitchablePresentation.jsp
If the servlet request was "http://localhost:8080/siteswitch/SwitchablePresentation.jsp" then the servlet filter:
https://github.com/tepietrondi/siteswitch/blob/master/src/siteswitch/filter/SiteSwitchFilter.java
would either allow the request or throw an error. The whole page is switchable.
Look again at: https://github.com/tepietrondi/siteswitch/blob/master/WebContent/SwitchablePresentation.jsp
There is JS logic to run check on the front end to determine the switch state. The JSON response page:
https://github.com/tepietrondi/siteswitch/blob/master/WebContent/SwitchablePresentation.jsp
will look up the component and respond with true or false for on and off.