我有一个在Tomcat中运行的Web应用程序,并使用Spring MVC来定义控制器和映射.我有以下课程:
@Controller("api.test")
public class TestController {
@RequestMapping(value = "/test", method = RequestMethod.GET)
public @ResponseBody String test(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
// body
}
}
Run Code Online (Sandbox Code Playgroud)
我想根据某处定义的属性(例如文件)使这个控制器和".../test"路径可用.如果属性是假设,我希望应用程序的行为就像该路径不存在一样,如果它是真的,则表现正常.我怎样才能做到这一点?谢谢.