0

The path param value is truncated randomly.

ex : myapplication/{pathparam}

Actual value "ab-cd-626-1.2.3.4 .6" is actually parsed as ab-cd-626-1.2.3.4. No idea why this is happening, please help

boopathiraja
  • 227
  • 5
  • 10
  • You can't have whitespace in a URL. You should be escaping all whitespace and non-standard URL characters: http://www.w3schools.com/tags/ref_urlencode.asp – woemler Feb 25 '16 at 21:28

2 Answers2

0

I am not shure where you use that pathparam, may be in a @RequestMapping of a controller method ?

I experienced problems,when the path param contains '.', so I avoid that at all. The problem stems from the way, the url is parsed by spring.

More discussion on that : pathvariable with dot is getting truncated

Community
  • 1
  • 1
0
<bean id="contentNegotiationManager"
    class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
    <property name="favorPathExtension" value="false" />
    <property name="favorParameter" value="true" />
    <property name="mediaTypes">
        <value>
            json=application/json
            xml=application/xml
        </value>
    </property>
</bean>
<mvc:annotation-driven
    content-negotiation-manager="contentNegotiationManager">
    <mvc:path-matching suffix-pattern="false" registered-suffixes-only="true" />
</mvc:annotation-driven>
boopathiraja
  • 227
  • 5
  • 10