Module io.jooby

Annotation Interface Path


@Retention(RUNTIME) @Target({TYPE,METHOD}) public @interface Path
Set a path for Mvc routes.
   @Path("/r")
   class Resources {

     @GET("/sub")
     public void method() {
     }
   }
 

Path Patterns

Jooby supports Ant-style path patterns:

Some examples:

  • com/t?st.html - matches com/test.html but also com/tast.jsp or com/txst.html
  • com/*.html - matches all .html files in the com directory
  • com/**/test.html - matches all test.html files underneath the com path
  • **/* - matches any path at any level.
  • * - matches any path at any level, shorthand for **/*.

Variables

Jooby supports path parameters too:

Some examples:

  • /user/{id} - /user/* and give you access to the id var.
  • /user/{id:\\d+} - /user/[digits] and give you access to the numeric id var.
Since:
0.1.0
Author:
edgar
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details

    • value

      String[] value
      Returns:
      Route path pattern.