Annotation Interface RoutingPath


@Target({TYPE,METHOD,FIELD}) @Retention(RUNTIME) @Documented public @interface RoutingPath
Path of a HttpService to register with routing. If a service is not annotated with this annotation, it would be registered without a path using HttpRules.register(io.helidon.webserver.http.HttpService[]). Configuration can be overridden using configuration:
  • fully.qualified.ClassName.routing-path.path to change the path.
Example class:
 @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 in ApplicationScoped and Dependent scopes
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Path of this WebServer service.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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

      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).
      See Also:
  • Element Details

    • value

      String value
      Path of this WebServer service. Use the same path as would be used with HttpRules.
      Returns:
      path to register the service on.