@RestOp-Annotated Method
REST Java methods are identified on REST servlets using the @RestOp annotation.
The annotation allows the framework to identify the available REST methods through reflection.
@RestOp(method=GET, path="/")
public String sayHello() {
return "Hello world!";
}
The following specialized annotations are also provided for specific HTTP methods:
@RestGet(path="/")
public String sayHello() {
return "Hello world!";
}
Additional information
Refer to the following Javadocs for more information:
In This Section
3.3.3.1. Inferred HTTP Methods and Paths
When the method and/or path values are not specified, their values are inferred from the Java method name.
3.3.3.2. Java Method Parameters
Java methods can contain any of the following parameters in any order:
3.3.3.3. Java Method Return Types
The return type of the Java method can be any serializable POJO as defined in POJO Categories.
3.3.3.4. Java Method Throwable Types
Annotated Java methods can throw any of the following:
3.3.3.5. Path Patterns
The @RestOp(path) annotation allows you to define
3.3.3.6. Matchers
RestMatcher is used to allow multiple Java methods to
3.3.3.7. Overloading HTTP Methods
Through the use of the built-in method GET parameter, you can implement requests beyond the basic REST http method