JavaEE6DemoScripts

Demo Scripts of Java EE 6 features in NetBeans 6.8

This page lists the demo scenarios for the Java EE 6 features. It is useful for presenting at conferences, universities etc.

JSF 2.0 editing and other features

This demo creates a login page application with a heavy use of JSF features: facelets templates, managed beans and composite components. It mainly showcases the editing features. The finished application is attached here.

[[[STEPSPENDING | [STEPS PENDING]]

End to End JPA 2.0, JSF 2.0, EJB 3.1, REST, SOAP

This demo creates a CRUD application from existing database, which displays data in web pages, and exposes the data through SOAP and REST web services.

  • Pre-work
  • Register GlassFish v3 in the IDE
  • Create a Java EE 5 CRUD application as follows
  • Create Java EE 5 web application with JSF 1.2 framework
  • Create Entities from Database (using the sample Derby database); when creating a persistence unit, choose the TopLink provider (this forces JPA 1.0)
  • Create JSF pages from these entity beans
  • Optionally, increase editor font size through the
    --fontsize
    command-line option
  1. Create a Java EE 6 web application with JSF 2.0 framework
  2. Create Entities from Database; use EclipseLink persistence provider
  3. Create JSF pages from Entity beans
  4. Run the application
  5. Open the Java EE 5 application created in pre-work
  6. Explore the code and compare to the EE 5 version
  • Show the code for entity classes (annotations, mapping to db columns)
  • Show the code for generated EJB 3.1 session beans (note the annotations). Compare to the EE 5 JPA controller classes - no transaction management, Criteria API for JPA queries instead of JPQL, much shorter code.
  • Show the code for web pages. Compare to the EE 5 version - facelets instead of JSP.
  • Show the code for managed beans (note the annotations).
  • Compare faces-config.xml to the EE 5 version - much shorter, because of the annotations.
  1. Go to the facelets pages and show editor features
  • Code completion for JSF tags (including namespace autoimport)
  • Code completion for expression language (aware of bean properties etc.)
  • Navigation from EL expressions to source code of the bean classes
  1. Go to a EJB 3.1 session bean and create JUnit test for it: note the generated setup code for embeddable EJB container, and the classpath setup.
  2. Create REST service from Entity classes (using the previously generated entity classes)
  3. Test the service using the Test RESTful Web Services action on the web application node
  • Show various REST resources and response data for these resources
  • Show output types: XML and JSON
  • Show various HTTP methods corresponding to CRUD operations (GET, PUT, DELETE)
  1. Create SOAP service from session beans by adding @WebService annotation
  2. Test this SOAP service, display its generated WSDL

Tips

  • Take advantage of Deploy on Save, no need to explicitly deploy after changes
  • Create code templates to add snippets of code that take long to type from scratch
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