Package io.helidon.microprofile.server
Annotation Interface RoutingPath
Path of a
Service
to register with routing.
If a service is not annotated with this annotation, it would be registered without a path using
Routing.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) {
rules.get("/hello", (req, res) -> res.send("Hello WebServer"));
}
}
Example configuration (yaml):
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
-
Required Element Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Configuration key of the routing path, appended after the fully qualified class name (does not contain the leading dot).
-
Field Details
-
CONFIG_KEY_PATH
Configuration key of the routing path, appended after the fully qualified class name (does not contain the leading dot).- See Also:
-
-
Element Details
-
value
String valuePath of this WebServer service. Use the same path as would be used withRouting.Rules
.- Returns:
- path to register the service on.
-