Am developing an application using spring boot. In REST controller i prefer to use path variable(@PathVariabale
annotation). My code fetching the path variable but it contatins { } braces as it is in the url. Please any one suggest me to solve this issue
@RequestMapping(value = "/user/item/{loginName}", method = RequestMethod.GET)
public void getSourceDetails(@PathVariable String loginName) {
try {
System.out.println(loginName);
// it print like this {john}
} catch (Exception e) {
LOG.error(e);
}
}
URL
http://localhost:8080/user/item/{john}
Out put in controller
{john}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…