Mapping and Choosing Controller Methods
Choosing Method by Param
Requests can be redirected to a method based on the params received:
In this case the request will be redirected to getEmployeesForAdmin if the request includes the admin parameter with the value true. If the value is false, or the argument is missing, then getEmployees will be used.
Choosing Method by Header
This works just like mapping through parameters:
Choosing Method by Media Type
Another way of redirecting is by using the expected result type:
This way the client can choose the data it receives, which can be useful for example for showing a default view in web services.
Last updated
Was this helpful?