0
 @RequestMapping(value = "/analyst/getcompany/{user}", method = RequestMethod.GET, produces = "application/json")
        public String getEmail(@PathVariable String user) {
    //logic
    }

when requesting this URI with:

"analyst/getcompany/[email protected]"

It is giving HTTP Status 406.

I encode the @ with %40 but {.} in the email id is creating a problem. how to handle this?

  • Possible duplicate of [Spring MVC @PathVariable with dot (.) is getting truncated](https://stackoverflow.com/questions/16332092/spring-mvc-pathvariable-with-dot-is-getting-truncated) – alfcope Oct 12 '17 at 13:08
  • @Prashant can you share how you resolved this issue? – WannaBeGeek Jan 20 '21 at 08:07

1 Answers1

1

This answer will help you. Path variable truncate after dot - annotation

You have to add trailing slash at the end of the path variable after name like

@RequestMapping(value ="/analyst/getcompany/{user}/")

The Request like

http://localhost:8080/analyst/getcompany/[email protected]/

mrtasln
  • 574
  • 1
  • 5
  • 18