简体   繁体   English

入站网关。 消除最后一个点之后的Url params

[英]inbound-gateway. Elimination Url params which is after last dot

I'm using following configuration to create an api endpoint in spring integration. 我正在使用以下配置在spring集成中创建api端点。

<int-http:inbound-gateway 
  request-channel="httpProjectRequest" 
  reply-channel="httpProjectResponce" supported-methods="GET" 
  path="/project/{key}" payload-expression="#pathVariables.key">
   <int-http:request-mapping consumes="application/json" produces="application/json"/>
 </int-http:inbound-gateway>

 <int:service-activator 
  ref="projectAPI" 
  method="get" 
  input-channel="httpProjectRequest" 
  output-channel="httpProjectResponce"/>

Problem which I'm facing is when i send GET request on /project/DFV-1.1 URL in "key" value I get DFV-1 , when i send GET request on /project/DFV-1.1.1 in key value is get DFV-1.1 我面临的问题是当我在/ /project/DFV-1.1 URL上发送GET请求“key”值时我得到DFV-1 ,当我在/project/DFV-1.1.1上发送GET请求时,键值是get DFV-1.1

Why it is ignoring value which is after last dot. 为什么它忽略了最后一个点之后的值。

Please, configure a bean like: 请配置一个像:

<beans:bean id="integrationRequestMappingHandlerMapping"
            class="org.springframework.integration.http.inbound.IntegrationRequestMappingHandlerMapping">
    <beans:property name="useSuffixPatternMatch" value="false"/>
</beans:bean>

That useSuffixPatternMatch description: 那个useSuffixPatternMatch描述:

/**
 * Whether to use suffix pattern match (".*") when matching patterns to
 * requests. If enabled a method mapped to "/users" also matches to "/users.*".
 * <p>The default value is {@code true}.
 * <p>Also see {@link #setUseRegisteredSuffixPatternMatch(boolean)} for
 * more fine-grained control over specific suffixes to allow.
 */
public void setUseSuffixPatternMatch(boolean useSuffixPatternMatch) {

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM