{8.0.0-new, 8.1.2-deprecated} Config
In {@doc MicroserviceConfig}, we described how to associate a configuration file with your microservice. In this section we describe how that configuration can be used to customize the behavior or your REST resource classes.
The most common usage for the configuration file is to reference values using the {@link oaj.config.vars.ConfigVar $C} variable in annotations.
For example, the {@link oajr.BasicRestConfig} interface that defines the annotations that control the look-and-feel of
classes that extend from {@link oajr.BasicRestServlet} use several
These values in turn are pulled from the external configuration file shown below.
Note that the configuration file can also contain
Configuration files can also be accessed programmatically. There are 3 primary ways of getting access to the config file:
Any {@doc RestSvlVariables initialization-time variables} can be used.
Any {@doc RestSvlVariables initialization-time variables} can be used.
Additional user-defined variables at the servlet level can be defined by adding a {@link oajr.annotation.HookEvent#INIT} hook method and using the {@link oajr.RestContextBuilder#vars(Class...)} method.
Any {@doc RestSvlVariables initialization-time or request-time variables} can be used.
Additional user-defined variables can be defined at this level by overriding the {@link oajr.RestContextBuilder#vars(Class...)} method.
That
This particular example is needlessly complex, but it gives an idea of how variables can be used recursively to produce sophisticated results