最后,感谢StéphaneNicoll,我找到了以下解决方案
server.context-parameters.*
仅适用于嵌入式服务器,因此在Java EE服务器上配置上下文参数是必要的,包括如下@Bean
类型ServletContextInitializer
:
@Bean public ServletContextInitializer contextInitializer() { return new ServletContextInitializer() { @Override public void onStartup(ServletContext servletContext) throws ServletException { servletContext.setInitParameter("dummy.type","on-context-parameters"); } }; }