Package io.helidon.microprofile.server
Annotation Type RoutingPath
-
@Target({TYPE,METHOD,FIELD}) @Retention(RUNTIME) @Documented public @interface RoutingPath
Path of aService
to register with routing. If a service is not annotated with this annotation, it would be registered without a path usingRouting.Rules.register(io.helidon.webserver.Service...)
. Configuration can be overridden using configuration:fully.qualified.ClassName.routing-path.path
to change the path.
@ApplicationScoped @RoutingPath("/myservice") @RoutingName(value = "admin", required = true) public class MyService implements Service { @Override public void update(Routing.Rules rules) {
Example configuration (yaml):rules.get("/hello", (req, res) -> res.send("Hello WebServer"));
} }com.example.MyService.routing-path: path: "/myservice-customized"
Limitations
RequestScoped
beans are NOT available for injection. Reactive services are designed to be built without request scoped injection. You can still use beans inApplicationScoped
andDependent
scopes
-
-
Field Summary
Fields Modifier and Type Fields Description static String
CONFIG_KEY_PATH
Configuration key of the routing path, appended after the fully qualified class name (does not contain the leading dot).
-
-
-
Field Detail
-
CONFIG_KEY_PATH
static final String CONFIG_KEY_PATH
Configuration key of the routing path, appended after the fully qualified class name (does not contain the leading dot).
-
-
Element Detail
-
value
String value
Path of this WebServer service. Use the same path as would be used withRouting.Rules
.- Returns:
- path to register the service on.
-
-