Annotation Interface Post


@Target(METHOD) @Retention(RUNTIME) public @interface Post
Marks a method as one which handles POST requests for a given resource

Typically used with AJAX requests.

The return value can either be a String, which is interpreted as a redirect URL; or it can be a JsonResult, which will be serialized back to the client

If null is returned then a response will be generated as if the request was a GET

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    If true, milton will attempt to bind request parameters to the source object If values are present and cannot be bound, will return a JsonResult containing field validation failures For this reason you should ONLY use data binding with AJAX posts
    If present, only requests which contain all of the given parameters will be matched
    The priviledge required to execute this POST request.
    If present, and not empty, identifies a request parameter which contains the timezone ID in the form post to use for parsing date/time values If empty the platform default will be used
  • Element Details

    • requiredPriviledge

      The priviledge required to execute this POST request. Note that the semantics of POST can vary widely, so can't easily be tied to a single priviledge. For example, commenting on an article is often done with a POST and it might be appropriate to permit comments from anyone with READ_CONTENT. On the other hand, POST might also be used for deleting comments which is usually an administrator action so might require WRITE_CONTENT
      Returns:
      Default:
      READ_CONTENT
    • params

      String[] params
      If present, only requests which contain all of the given parameters will be matched
      Returns:
      Default:
      {}
    • bindData

      boolean bindData
      If true, milton will attempt to bind request parameters to the source object If values are present and cannot be bound, will return a JsonResult containing field validation failures For this reason you should ONLY use data binding with AJAX posts
      Returns:
      Default:
      false
    • timeZoneParam

      String timeZoneParam
      If present, and not empty, identifies a request parameter which contains the timezone ID in the form post to use for parsing date/time values If empty the platform default will be used
      Returns:
      Default:
      ""