zl程序教程

您现在的位置是:首页 >  后端

当前栏目

spring boot 集成disconf详解编程语言

2023-06-13 09:11:49 时间

1.spring boot配置disconf需要在启动类上配置读取xml的入口注解:@ImportResource({ classpath:spring-disconf.xml })

package com.zpark; 

import org.springframework.boot.SpringApplication; 

import org.springframework.boot.autoconfigure.SpringBootApplication; 

import org.springframework.context.annotation.ImportResource; 

import org.springframework.scheduling.annotation.EnableScheduling; 

 * @author cosmo 

 * @Title: SptingbootApplication 

 * @ProjectName 

 * @Description: Sptingboot启动类 

 * @date 2019/1/2211:11 

@SpringBootApplication 

@EnableScheduling 

@ImportResource({"classpath:spring-disconf.xml"}) 

public class SptingbootApplication { 

 public static void main(String[] args) { 

 SpringApplication.run(PacificServiceApplication.class, args); 

}

剩下的跟spring集成disconf的步骤都是一样的,详情参见:Spring MVC 集成Disconf

原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/18580.html

cjavaxml