Camel rest URI 使用后缀 [英] Camel rest URI works with suffix

查看:28
本文介绍了Camel rest URI 使用后缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个使用 Camel 的 REST 网络服务.

So I have a REST webservice using Camel.

它工作得很好,只是如果我用后缀调用我的 URI,我会得到相同的响应,而不是 404.

it works just fine except that if I call my URI with a suffix I get the same response and not a 404.

休息配置:

restConfiguration()
.component("restlet")
.bindingMode(RestBindingMode.json) 
.dataFormatProperty("prettyPrint", "true") 
.contextPath(contextPath).host(host).port(port); 

rest("/ressource") .description("ressource")
.consumes("application/json") .produces("application/json") 
.get().outType(Ressource.class)
.to("bean:ressourceImpl?method=getRessource")

示例:

本地主机:8090/service/ressource

localhost:8090/service/ressource

返回我的资源

本地主机:8090/service/ressource85468461569

localhost:8090/service/ressource85468461569

返回我的资源

正常吗?我认为它应该只返回 404

Is it normal ? I thought it should just return 404

推荐答案

是的,目前不支持.

我已经记录了一张票来改进这个:https://issues.apache.org/jira/browse/CAMEL-12320

I have logged a ticket to improve this: https://issues.apache.org/jira/browse/CAMEL-12320

这篇关于Camel rest URI 使用后缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆