Annotation Interface Controller


Indicates that the role of a class is a controller within an application.

Since:
1.0
Author:
Graeme Rocher
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
    Allows specifying an alternate port to run the controller on.
     
    This attribute returns the base URI of the controller
  • Element Details

    • value

      This attribute returns the base URI of the controller

      A value of / can be used to map a controller to the root URI.

      Returns:
      The base URI of the controller in the case of web applications
      Default:
      "/"
    • produces

      Returns:
      The produced MediaType values. Defaults to application/json
      Default:
      {"application/json"}
    • consumes

      Returns:
      The consumed MediaType for request bodies Defaults to application/json
      Default:
      {"application/json"}
    • port

      String port
      Allows specifying an alternate port to run the controller on. Setting this member will cause.

      The member is defined as a string to allow resolving the port value from configuration. For example: member = "${my.port.number}"

      Returns:
      The port to use.
      Default:
      ""