|Modifier and Type||Required Element and Description|
Returns the URI pattern which describes matching request.
|Modifier and Type||Optional Element and Description|
Determines if the annotated method is used to generate a JSON response.
Determines if the annotated method supports pre-dispatching.
Sets the priority used for this route.
public abstract String value
The pattern should start with a / character, which is also use to separate path elements. Each element can be one of the following:
NLS. The resulting string must match the part in the request URI
public abstract int priority
For non-conflicting URIs, this can be skipped. For everything else, the lower the better ;-)
public abstract boolean preDispatchable
A pre-dispatchable method takes care of the requests payload itself. Therefore the method must declare an
additional parameter of type
InputStreamHandler which will be used to consume
the data sent via POST or PUT.
public abstract boolean jsonCall
This can be used to handle AJAX requests directly within a controller. In such simple cases if is often
feasible to keep the logic in one place (controller) instead for creating a
A method having jsonCall set to true has to accept
JSONStructuredOutput as 2nd parameter. This parameter is filled with a
pre-initialized output writer, which has
JSONStructuredOutput.endResult() automatically called.
Also the properties success and error are automatically filled. In case on an exception within the controller method, a result with success, errro and message is automatically created.
Note: If implementing method does fork a new thread and pass the given output along,
the method must return a
so that the dispatcher knowns when the generated output is complete.
Copyright © 2018. All rights reserved.