I have a web application running in Tomcat and using Spring MVC to define controllers and mappings. I have the following class:
@Controller("api.test")
public class TestController {
@RequestMapping(value = "/test", method = RequestMethod.GET)
public @ResponseBody String test(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
// body
}
}
I would like to make this controller and the ".../test" path available according to a property defined somewhere (e.g. file). If the property is, lets say, false, I would like the app to behave as if that path doesn't exist and if it is true, to behave normally. How can I do this? Thanks.