1

I am developing a rest webservice my @RequestMapping is like /{bookId}/list

How do I pass the book Id in the request I am trying //localhost:80003/123/list but its not working

What should I make sure so that I can pass dynamic values in request URL for a res service

Thanks

pinky
  • 129
  • 1
  • 1
  • 5
  • You are connecting to localhost:80003, where port 80003 is out of port range. (Max is 65535) Also we need more information about what is not working. – Ercksen Sep 01 '14 at 14:59

1 Answers1

0

I am guessing you entered one too many zeros in your port since 80003 is not valid. Anyway, you can use @PathVariable like this:

@RequestMapping(value = "/{bookId}/list", method = RequestMethod.GET)
public @ResponseBody Video getId(@PathVariable("bookId") long id) {
     ...
}
DanielM
  • 3,598
  • 5
  • 37
  • 53
  • Actually i need to do @RequestMapping(value = "/{bookId}/list/{shelfId}" Cant I send 2 dynamic values. I corrected the number of zeroes in 80003 and it worked (Thanks/. :)). But its not working for 2 dynamic values. – pinky Sep 01 '14 at 15:05
  • Check this: http://stackoverflow.com/questions/11351015/multiple-pathvariable-in-spring-mvc – DanielM Sep 01 '14 at 15:34