本文介绍了带有点 (.) 的 Spring MVC @PathVariable 被截断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是问题的延续Spring MVC @PathVariable 被截断

Spring 论坛声明它已修复(3.2 版本)作为 ContentNegotiationManager 的一部分.请参阅以下链接.
https://jira.springsource.org/browse/SPR-6164
https://jira.springsource.org/browse/SPR-7632

Spring forum states that it has fixed(3.2 version) as part of ContentNegotiationManager. see the below link.
https://jira.springsource.org/browse/SPR-6164
https://jira.springsource.org/browse/SPR-7632

在我的应用程序中,带有 .com 的 requestParameter 被截断.

In my application requestParameter with .com is truncated.

谁能解释一下如何使用这个新功能?它如何在 xml 中配置?

Could anyone explain me how to use this new feature? how is it configurable at xml?

注意:春季论坛-#1带有点 (.) 的 Spring MVC @PathVariable 被截断

推荐答案

据我所知,这个问题只出现在请求映射末尾的路径变量上.

As far as i know this issue appears only for the pathvariable at the end of the requestmapping.

我们能够通过在请求映射中定义正则表达式插件来解决这个问题.

We were able to solve that by defining the regex addon in the requestmapping.

 /somepath/{variable:.+}

这篇关于带有点 (.) 的 Spring MVC @PathVariable 被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-23 21:22