Form handlers use special handler methods for linking form elements with Nucleus components. One of the more powerful features in the ATG Platform REST Web Services module is the ability to call handler methods. If you have existing JSP-based applications, all the functionality which has previously been exposed in those applications can be reused with REST based applications. Use RestComponentHelper.executeMethod()
to call handler methods.
Keep the following in mind when calling a handler method
The method name, the second argument in the
executeMethod()
method, should not contain the “handle” prefix. For example, to call thehandleCreate
method, it should be specified simply ascreate
in thepMethodName
argument.The
pArguments
parameter should always be null when you call a handler method.
The following code sample calls the handleCreate
method on a specified form handler:
RestResult result = RestComponentHelper.executeMethod("/some/FormHandler", "create", null, null, session)
As long as a form handler does not submit a redirect, the execution would be similar to a regular method call. For those form handler methods which do redirect, the redirect will be intercepted and returned back to the client as an exception.