This is continuation of question Spring MVC @PathVariable getting truncated
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
In my application requestParameter with .com is truncated.
Could anyone explain me how to use this new feature? how is it configurable at xml?
Note: spring forum- #1 Spring MVC @PathVariable with dot (.) is getting truncated
If you are using Spring 3.2.x and
<mvc:annotation-driven />
, create this littleBeanPostProcessor
:Then put this in your MVC config xml:
Finally I found solution in Spring Docs:
Adding this to my
WebMvcConfigurerAdapter
implementation solved the problem:/somepath/{variable:.+}
works in JavarequestMapping
tag.Here's an approach that relies purely on java configuration:
In Spring Boot, The Regular expression solve the problem like
adding the ":.+" worked for me, but not until I removed outer curly brackets.
value = {"/username/{id:.+}"} didn't work
value = "/username/{id:.+}" works
Hope I helped someone :)