Mapping and Choosing Controller Methods
Choosing Method by Param
@GetMapping(produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public final Iterable<Employee> getEmployees(final Pageable page)
@GetMapping(produces = MediaType.APPLICATION_JSON_UTF8_VALUE, params = "admin=true")
public final Iterable<Employee> getEmployeesForAdmin(final Pageable page)
@GetMapping(produces = MediaType.APPLICATION_JSON_UTF8_VALUE, params = { "admin=true", "flag=true" } )
public final Iterable<Employee> getEmployeesForAdminAlternative(final Pageable page)Choosing Method by Header
@GetMapping(produces = MediaType.APPLICATION_JSON_UTF8_VALUE, headers = "admin=true")
public final Iterable<Employee> getEmployeesForAdmin(final Pageable page)Choosing Method by Media Type
Last updated