I am running into this issue since I have an app that has restful services but I need to serve up some static ones too. In this app I also use the EnableSwagger2
annotation. It looks like this class is public and I could subclass it but I am not sure how to configure that. My goal is to override this line so I can have control over 404s.
答案 0 :(得分:2)
所以我终于做到了这一点,它成功地为我工作。配置让我有点但是在这里。假设您将一个名为ResourceHttpRequestHandler
的{{1}}子类化。在我的CustomResourceHandler
中,这正确地连接了它:
Application.java