This annotation is used to enable MVC-specific binding rules for a JAX-RS parameter binding. It can
be placed on fields and method parameters together with JAX-RS binding annotations such as
FormParam
,
QueryParam
, etc.
MVC parameter binding differs from traditional JAX-RS parameter binding in the following aspects:
- In JAX-RS binding and validation errors result in an exception being thrown which can
only be handled by a corresponding exception mapper. This usually doesn't make sense for web
applications, because errors must be processed by the controller, so they can be
displayed on the resulting HTML page. In case of MVC bindings such errors don't prevent the controller
from being invoked and are instead made available via the injectable
BindingResult
class.
- JAX-RS parameter type conversion isn't locale-aware. The standard JAX-RS converters
always use a fixed locale to parse numbers and dates. In MVC applications users typically
enter data into forms in their native locale. Therefore, MVC bindings perform data type
conversion by respecting the request locale resolved via
LocaleResolver
.