{8.1.0-new, 8.1.2-updated} @Rest(path)
The {@link oajr.annotation.RestResource#path() @RestResource(path)} annotation is used in the following situations:
The typical usage is to define a path to a child resource relative to the parent resource.
In the example above, assuming the
Note that in this scenario, the
The path can also be used on top-level resources deployed as Spring beans when used with the {@link oajr.springboot.JuneauRestInitializer} Spring Boot initializer class:
In this case, the servlet will get registered using the path defined on the resource class.
The path can contain variables that get resolved to {@link oaj.http.annotation.Path @Path} parameters or access through the {@link oajr.RestRequest#getPathMatch()} method.
Variables can be used on either top-level or child resources and can be defined on multiple levels.
When variables are used on a path of a top-level resource deployed as a Spring bean in a Spring Boot application, the first part of the URL must be a literal which will be used as the servlet path of the registered servlet.