For each RESTful resource class, you can generate a JavaScript client that makes it easy for client applications to access a RESTful service. You can use wizards in the IDE to generate JavaScript clients in web applications and HTML5 applications.
To generate a JavaScript client in a Java web application you can use a wizard to generate a client stub for a local project that contains a RESTful service. The wizard can also generate a stub that is based on the URL of the WADL file of a RESTful service.
If you expand the Web Pages node in the Projects window you will notice that you have a 'rest' node that contains the generated JavaScript classes and a 'TestStubs.html' file. You can right-click the html file and choose View to view the generated test page that lists URIs to the client stubs. You can click the URIs to test that the client stub generation was successful.
See the following documentation for more about the Java.net WADL project.
To generate a JavaScript client in an HTML5 application you can use a wizard to generate a client for a local project that contains a RESTful service. In the wizard you also have the option of specifying a table as the user interface.
Perform the following steps to generate a JavaScript client for a RESTful web service.
When you click Finish the IDE generates the JavaScript file in the location that you specified in the wizard. If you selected Tablesorter as the UI for the client, the IDE generates the HTML file with the name and in the location that you specified.