Sometimes we need to pass parameters along with the url to get the data. In Spring MVC framework, we can customize the URL in order to get data. For this purpose @PathVariable annotation is used in Spring framework. @PathVariable is used to obtain some placeholder from the uri (Spring call it an URI Template).
@RequestParam is used to obtain an request parameter. @RequestParam binds a request parameter to a parameter in your method.
For example you want to write a url to get user's details according to createDate as below
As you can see in the above example "emailId" is a PathVariable and "createDate" is a RequestParam, so if we use url http://localhost:8080/app/findMeemail@example.com?createDate=09-18-2015, then emailId variable will be populated by value firstname.lastname@example.org and the value of the parameter named "createDate" will be passed as the "createDate" argument in the above method.