日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

springboot webservice接口调用_springboot远程调用dubbo服务接口

發布時間:2025/4/5 编程问答 49 豆豆
生活随笔 收集整理的這篇文章主要介紹了 springboot webservice接口调用_springboot远程调用dubbo服务接口 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.首先idea新建一個springboot項目,這里簡單介紹下:

2.在springboot啟動類上加入注解

@ImportResource(locations = {"classpath*:dubbo_config/*.xml"})

locations 為你的dubbo相關配置文件路徑

3.pom文件配置

<?xml version="1.0" encoding="UTF-8"?>4.0.0org.springframework.boot spring-boot-starter-parent 2.1.9.RELEASEcom.example demo 0.0.1-SNAPSHOTdemoDemo project for Spring Boot1.8org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-test testcom.** ****-api 1.2.4com.** ****-client 1.2.4io.dubbo.springboot spring-boot-starter-dubbo RELEASEorg.apache.zookeeper zookeeper 3.4.6org.slf4j slf4j-log4j12 log4j log4j org.springframework.boot spring-boot-maven-plugin

4.application name配置

<?xml version="1.0" encoding="UTF-8"?>

5.controller調用

@Controllerpublic class MemberIndexController { @Autowired private DemoService demoService; /** * @RestController 相當于@Controller + @ResponseBody * 第一種啟動方式:@EnableAutoConfiguration 注解作用:掃描范圍:默認當前類里面, * SpringApplication.run(MemberController.class); * 第二種加上掃描范圍 */ @RequestMapping("/memberIndex") @ResponseBody public String memberIndex() { demoService.sayHello("SpringBoot Dubbo test"); System.out.println("memberIndex"); return "springboot成功+memberIndex"; }}

總結

以上是生活随笔為你收集整理的springboot webservice接口调用_springboot远程调用dubbo服务接口的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。