美文网首页
SpringBoot启动加载数据

SpringBoot启动加载数据

作者: 我是晓梦啊 | 来源:发表于2021-03-09 23:15 被阅读0次
    import lombok.extern.slf4j.Slf4j;
    import org.springframework.beans.factory.InitializingBean;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.web.context.ServletContextAware;
    import javax.servlet.ServletContext;
    import java.util.List;
    import java.util.Map;
    import java.util.concurrent.ConcurrentHashMap;
    
    @Configuration
    @Slf4j
    public class InitOrganizationInfoConfig implements InitializingBean, ServletContextAware {
    
        public static Map<String, String> ORGANIZATION_INFO = new ConcurrentHashMap<String, String>();
    
        @Override
        public void setServletContext(ServletContext servletContext) {
               ORGANIZATION_INFO.put("key","value");
            log.info("*********一共有"+l+"条************");
        }
        @Override
        public void afterPropertiesSet() throws Exception {
    
        }
    
    }
    

    相关文章

      网友评论

          本文标题:SpringBoot启动加载数据

          本文链接:https://www.haomeiwen.com/subject/eaoxqltx.html