How to set ServletContext property for a bean in Spring XML metadata configuration

后端 未结 4 2108
名媛妹妹
名媛妹妹 2021-01-14 23:14

I tried searching here on SO but i couldn\'t find a solution. I have some XML metadata like the following.



        
4条回答
  •  我在风中等你
    2021-01-14 23:38

    With java config use ServletContextFactory created by Serge Ballesta above and:

    @Configuration
    public class WebAppConfiguration {
    
        @Autowired
        private ServletContextFactory servletContextFactory;
    
        @Bean
        public ServletContextFactory servletContextFactory() {
             return new ServletContextFactory();
        }
    }
    

提交回复
热议问题