admin管理员组文章数量:1026989
I am using Spring Boot 3.3.5 and I create custom contexts by overriding tomcatFactory.
As all our custom contexts share similar behavior (same REST Controller, same behavior) and is only differentiated by their Context Path to help us differentiate which custom Data Source to access, is it OK for all the web contexts to use the same AnnotationConfigWebApplicationContext
and DispatcherServlet
?
My only concern is the AnnotationConfigWebApplicationContext.setServletContext
which is required by some Spring Boot web autoconfiguration, and I only call this once by setting the ServletContext of the first custom Context created.
I am using Spring Boot 3.3.5 and I create custom contexts by overriding tomcatFactory.
As all our custom contexts share similar behavior (same REST Controller, same behavior) and is only differentiated by their Context Path to help us differentiate which custom Data Source to access, is it OK for all the web contexts to use the same AnnotationConfigWebApplicationContext
and DispatcherServlet
?
My only concern is the AnnotationConfigWebApplicationContext.setServletContext
which is required by some Spring Boot web autoconfiguration, and I only call this once by setting the ServletContext of the first custom Context created.
本文标签:
版权声明:本文标题:java - In Spring Boot Web, Is it safe to share AnnotationConfigWebApplicationContext between multiple Web Contexts - Stack Overf 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745668532a2162316.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论