@RequestParam


 


@RequestMapping(value="/data",method=RequestMethod.GET)
public List<Data> getData(
    @RequestParam(value="max",defaultValue="10") long max,
    @RequestParam(value="count", defaultValue="20") int count) {
    //find data and return list
}

here the max and count parameter are added in the URl as a query parameters as given below
/users/data?max=10&count=20
If not value received in max or count variable then default values will be used.
the type conversion happens automatically.