Annotation Interface EntryPath


@Target({METHOD,TYPE}) @Retention(RUNTIME) public @interface EntryPath
Public methods with this annotation in Controller-annotated classes are considered entry points via HTTP requests. Can also be on the controller class itself to declare a base path for all of the described endpoints.

The method return type influences what gets sent back as content. If the method returns void, then responding must be handled some other way (via HttpServletResponse).

Author:
Matthew Tropiano
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The entry point path (after controller path resolution).
  • Element Details

    • value

      String value
      The entry point path (after controller path resolution).

      The entry path is a URI path that can contain statically-named tokens, path variables, path variables qualified by a RegEx to match, or be terminated with an asterisk for a path folder to mean that anything after the path is accepted.

      Valid paths can look like:

      • /pages/home - a static URI.
      • /pages/@page-name - a URI with a path variable called page-name.
      • /pages/@page-name/@paragraph-id - a URI with two path variables called page-name and paragraph-id.
      • /document/@id:[a-zA-Z]{4}/data - a URI with a path variable called id that must a RegEx (matches 4 letters).
      • /file/* - a URI with an open-ended path after /file/.
      • /* - all URIs.
      URI path folder search is prioritized from most specific to least - static pattern, variable with RegEx, variable without, then default paths.

      If unchanged, this is the DEFAULT entry point ("*"), if no matching method is found. You may not specify more than one DEFAULT entry in a controller. Specified path is ignored.

      Returns:
      the path.
      Default:
      "*"