Overloading HTTP Methods

Through the use of the built-in "method" GET parameter, you can implement requests beyond the basic REST http method types.

For example, the URL "/sample/foo?method=BAR" will cause the following method to be invoked...

@RestMethod(name="BAR") public void doBar(RestRequest req, RestResponse res) { // Handle BAR requests }

To support overloaded methods, the {@link oajr.annotation.RestResource#allowedMethodParams() @RestResource(allowedMethodParams)} setting must be enabled on your servlet.

@RestResource( // Allow &method parameter on BAR requests allowedMethodParams="BAR" )