Annotation Type Template


  • @NameBinding
    @Retention(RUNTIME)
    @Target(TYPE)
    public @interface Template
    Declare template file in classpath, relative to current class or any registered root templates dir (in classpath).

    It is required to use this annotation on template resources. Even if each method in resource use its own template, resource class must be annotated with empty annotation.

    Template path could also be absolute (in this case it must start with "/" - classpath root).

    Annotation is also NameBinding, which allows easily apply filters ( ContainerRequestFilter and ContainerResponseFilter) only for template resources (see TemplateAnnotationFilter as example).

    Since:
    03.12.2018
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String value  
    • Element Detail

      • value

        java.lang.String value
        Returns:
        template path, relative to annotated class or absolute path
        Default:
        ""