Can I use path variable for spring controller class?
I know that we can use path variables in controller\'s methods. In the same fashion can we use it for entire cl
Yes you can. Just declare it as @PathVariable in your methods if you want to access it there.
@Controller
@RequestMapping(value = "{version}/test")
class TestController {
@RequestMapping(value="/something")
public ModelAndView doSomething(@PathVariable String version) {
// do something here with the version
}
}