Package io.milton.annotations
Annotation 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 ElementsModifier and TypeOptional ElementDescriptionbooleanIf 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[]If present, only requests which contain all of the given parameters will be matchedThe 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
AccessControlledResource.Priviledge requiredPriviledgeThe 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[] paramsIf present, only requests which contain all of the given parameters will be matched- Returns:
- Default:
- {}
-
bindData
boolean bindDataIf 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 timeZoneParamIf 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:
- ""
-