Easel Demo Script for REST services client - April 2013

This script shows the Easel REST services client feature in context of NetBeans 7.4 and new features available in this release, as of April 2013. In addition to NetBeans 7.3 features, it also demonstrates the following 7.4 features:

  • Network monitor
  • Java EE 7 projects and deployment to GlassFish 4
  • JAX-RS 2.0 filters

Prerequsites and prework

  • Register the latest GlassFish 4 promoted build in the IDE
  • Start GlassFish (to speed the first deployment up)
  • Download and unzip the server part of the sample application attached here

Demo steps

  1. Open the attached MyRestServiceTest sample project in the IDE
    • Alternatively, this project can be created from scratch (Java EE 7 web application, entities from database for the Manufacturer table, REST service from this entity)
  2. Run the application on the GlassFish registered in the IDE
  3. Create a new HTML5 project, choose HTML boilerplate template
  4. Create RESTful JavaScript client
    • don't forget to change folder to public_html
    • choose TableSorter UI
  5. Run the project - loading data will fail
  6. Go to Network Monitor to analyze the failure
  7. Create Cross-Origin Resource Sharing filter in the server-side project using the wizard. This filter uses the new standard JAX-RS 2.0 filter API; prior to JAX-RS 2.0 you needed to use Jersey-specific proprietary APIs.
  8. Add this filter to ApplicationConfig (getRestResourceClasses method must return it)
  9. Deploy the server-side project
  10. Refresh the browser
  11. Show the requrest-response data in Network Monitor, including the stack trace etc.
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo