Package io.milton.annotations
Annotation Type Post
-
@Target(METHOD) @Retention(RUNTIME) public @interface Post
Marks a method as one which handles POST requests for a given resourceTypically 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
nullis 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 booleanbindDataIf 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 postsString[]paramsIf present, only requests which contain all of the given parameters will be matchedAccessControlledResource.PriviledgerequiredPriviledgeThe priviledge required to execute this POST request.StringtimeZoneParamIf 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 Detail
-
requiredPriviledge
AccessControlledResource.Priviledge 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:
- io.milton.resource.AccessControlledResource.Priviledge.READ_CONTENT
-
-
-
params
String[] params
If present, only requests which contain all of the given parameters will be matched- Returns:
- Default:
- {}
-
-
-
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:
- ""
-
-