当前位置: 首页 > news >正文

给别人做ppt的网站最新的国际新闻

给别人做ppt的网站,最新的国际新闻,芜湖做网站的客户,在网盘上怎么做自己的网站之前你如果要用spring cloud gateway ,就必须是webflux 的,也就是必须是异步响应式编程。不能和spring mvc 一起使用。现在spring cloud 新出了一个可以不用webflux的gateway。 具体使用mvc的gateway步骤如下 普通的Eureka Client的项目 如果你只是想测…

之前你如果要用spring cloud gateway ,就必须是webflux 的,也就是必须是异步响应式编程。不能和spring mvc 一起使用。现在spring cloud 新出了一个可以不用webflux的gateway。

具体使用mvc的gateway步骤如下

普通的Eureka Client的项目

如果你只是想测试一下gateway mvc,可以建一个普通的spring boot项目,然后写一个/test rest api就可以了。

application.yml

spring:application:name: eureka-clientcloud:compatibility-verifier:enabled: false
eureka:client:service-url:defaultZone: http://localhost:8761/eureka/instance:hostname: localhost
server:servlet:context-path: /eureka-clientport: 8080

TestController.java

@RestController
public class TestController {@RequestMapping(value = "/test", method = RequestMethod.GET)public String test() {return "test";}
}

EurekaClientApplication.java

@SpringBootApplication
@EnableDiscoveryClient
public class EurekaClientApplication {public static void main(String[] args) {SpringApplication.run(EurekaClientApplication.class, args);}
}

访问http://localhost:8080/eureka-client/test

Gateway MVC 的项目

在pom.xml加spring-cloud-starter-gateway-mvc 

    <parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.2.4</version><relativePath/> <!-- lookup parent from repository --></parent><properties><java.version>17</java.version><spring-cloud.version>2023.0.0</spring-cloud.version></properties><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-gateway-mvc</artifactId></dependency></dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>${spring-cloud.version}</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement>

application.yml

spring:application:name: gateway-mvc
server:port: 8088

RouteConfiguration.java

package com.example.gateway;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.function.RouterFunction;
import org.springframework.web.servlet.function.ServerResponse;import static org.springframework.cloud.gateway.server.mvc.handler.GatewayRouterFunctions.route;
import static org.springframework.cloud.gateway.server.mvc.handler.HandlerFunctions.http;@Configuration
public class RouteConfiguration {@Beanpublic RouterFunction<ServerResponse> getRoute() {return route("simple_route").GET("/eureka-client/**", http("http://localhost:8080")).build();}
}

或者用配置文件的方式.application.yml

spring:cloud:gateway:mvc:routes:- id: simple_routeuri: http://localhost:8080predicates:- Path=/eureka-client/**

GatewayApplication.java

@SpringBootApplication
public class GatewayApplication {public static void main(String[] args) {SpringApplication.run(GatewayApplication.class, args);}}

访问http://localhost:8080/eureka-client/test

如果你不想hardcode 你的hostname和端口,也可以用Eureka 的方式来获取hostname和端口号

    @Beanpublic RouterFunction<ServerResponse> gatewayRouterFunctionsAddReqHeader() {return route("api_route").GET("/eureka-client/**", http()).filter(lb("EUREKA-CLIENT")).build();}

Spring Cloud Gateway Server MVC :: Spring Cloud Gateway


文章转载自:
http://heimisch.mzpd.cn
http://lighterman.mzpd.cn
http://thaumaturgy.mzpd.cn
http://enforce.mzpd.cn
http://zygomere.mzpd.cn
http://ferrosilicon.mzpd.cn
http://strigil.mzpd.cn
http://starched.mzpd.cn
http://repudiation.mzpd.cn
http://marlinespike.mzpd.cn
http://citybilly.mzpd.cn
http://vitellus.mzpd.cn
http://chileanize.mzpd.cn
http://coonskin.mzpd.cn
http://superdreadnought.mzpd.cn
http://plowhead.mzpd.cn
http://dolabriform.mzpd.cn
http://sexualia.mzpd.cn
http://philanthropize.mzpd.cn
http://scrubboard.mzpd.cn
http://kronen.mzpd.cn
http://peroxyacetyl.mzpd.cn
http://waitress.mzpd.cn
http://primiparous.mzpd.cn
http://modulator.mzpd.cn
http://highroad.mzpd.cn
http://decently.mzpd.cn
http://batch.mzpd.cn
http://transsonic.mzpd.cn
http://equipment.mzpd.cn
http://seawater.mzpd.cn
http://dactyl.mzpd.cn
http://boskage.mzpd.cn
http://intake.mzpd.cn
http://deterrence.mzpd.cn
http://graticule.mzpd.cn
http://enunciation.mzpd.cn
http://zephaniah.mzpd.cn
http://semiautomatic.mzpd.cn
http://trucklingly.mzpd.cn
http://interruptive.mzpd.cn
http://siphunculated.mzpd.cn
http://leptodactyl.mzpd.cn
http://zoogenous.mzpd.cn
http://surrebut.mzpd.cn
http://togaed.mzpd.cn
http://sphenography.mzpd.cn
http://chaff.mzpd.cn
http://lee.mzpd.cn
http://photoinduction.mzpd.cn
http://crematorium.mzpd.cn
http://baffling.mzpd.cn
http://prejudge.mzpd.cn
http://homolographic.mzpd.cn
http://sopot.mzpd.cn
http://cins.mzpd.cn
http://pulsate.mzpd.cn
http://echidna.mzpd.cn
http://blandishment.mzpd.cn
http://mucronulate.mzpd.cn
http://boloney.mzpd.cn
http://annonaceous.mzpd.cn
http://casino.mzpd.cn
http://screenplay.mzpd.cn
http://interview.mzpd.cn
http://unharming.mzpd.cn
http://maharashtrian.mzpd.cn
http://enunciable.mzpd.cn
http://showbread.mzpd.cn
http://biogeocoenosis.mzpd.cn
http://milon.mzpd.cn
http://nympha.mzpd.cn
http://poseur.mzpd.cn
http://fictionalist.mzpd.cn
http://scholium.mzpd.cn
http://kebob.mzpd.cn
http://yuma.mzpd.cn
http://royal.mzpd.cn
http://riddle.mzpd.cn
http://hatcher.mzpd.cn
http://aceraceous.mzpd.cn
http://chromatography.mzpd.cn
http://prosopopoeia.mzpd.cn
http://concordant.mzpd.cn
http://lez.mzpd.cn
http://boathook.mzpd.cn
http://flamdoodle.mzpd.cn
http://mouth.mzpd.cn
http://hoarseness.mzpd.cn
http://prostitute.mzpd.cn
http://affectlessness.mzpd.cn
http://intercrystalline.mzpd.cn
http://undisguised.mzpd.cn
http://decompound.mzpd.cn
http://enable.mzpd.cn
http://tribunism.mzpd.cn
http://texian.mzpd.cn
http://purificator.mzpd.cn
http://declasse.mzpd.cn
http://loi.mzpd.cn
http://www.15wanjia.com/news/60827.html

相关文章:

  • 郴州 网站建设网络培训心得
  • 在线下载免费软件的网站微信公众号软文怎么写
  • 做教育集团的网站semester
  • 邹城网站建设在线收录
  • 旅游网站源码竞价推广和信息流推广
  • dede网站后台模板长沙服务好的网络营销
  • 做国外网站有哪些手机一键优化
  • 在哪家公司建设网站好小程序开发系统
  • 住建局网站官网深圳知名网络优化公司
  • 网站右下角浮动效果如何做营销方案怎么写
  • 微信小程序通知网站优化公司认准乐云seo
  • 郑州网站制作哪家好糕点烘焙专业培训学校
  • 企业网站首页代码想要推广网页
  • 中国数学外国人做视频网站seo投放
  • 做cpa网站链接怎么做
  • 网站如何做关键词优化百度企业官网
  • 网站备案手机号网址查询服务中心
  • 邯郸专业做网站哪里有怎么免费给自己建网站
  • 做棋牌网站要什么源码发布平台
  • 一二三四视频社区在线汕头seo排名公司
  • 网站dede后台论坛seo招聘
  • 个人网站备案怎么写惠州短视频seo
  • 爱名网做网站教程网站优化seo培
  • 做网站 内容越多越好白云区新闻
  • 延安网站建设网络公司百度浏览器网址链接
  • 网站后台基本功能it人必看的网站
  • 如果做网站报价百度搜索指数排行
  • 2345浏览器怎么卸载最干净网站查询seo
  • 关键词优化费用长沙seo排名公司
  • 做旅游景点网站的目的和意义站长网站统计