Tuesday Jan 31, 2012

Java EE 6 samples in the SDK


GlassFish can be downloaded in different forms and shape. Here are some of the main websites that provide a pre-packaged bundle:
And then all the deveoper JARs are checked in to Maven and of course you can check out and build the workspace. GlassFish Server Open Source Edition is used for bundling with NetBeans, Eclipse, and JDK. The diagram below shows the main difference between the open source and the commercial edition. The GlassFish For Business blog explains the benefits for commercial edition over open source and this particular blog highlights the difference between the two.

The diagram below highlights the difference between Oracle GlassFish Server and Java EE 6 SDK from the packaging perspective.



The Java EE 6 SDK provides API docs, tutorial and even has a JDK co-bundle. One of the hidden nuggets of the SDK is a comprehensive list of the Java EE 6 samples. The complete list is inlined here:


Sample Application Description
Enterprise Java Beans
EJB 3.1 WAR-based Application An EJB application that shows the use of WAR-based packaging , the no-interface Local view, Singleton session beans, and startup/shutdown callbacks.
EJB 3.1 Embeddable API A very simple EJB Stateless Session Bean with a no-interface view and a POJO Entity that demonstrates EJB 3.1 Embeddable API usage.
EJB 3.1 Automatic Timer An EJB Stateless Session Bean with a Remote business interface and a POJO Entity that demonstrates EJB 3.1 automatic timer feature.
Servlet 3.0
Servlet 3.0 Annotations Application A Servlet 3.0 application using annotations for servlet, filter, and content listener.
Servlet 3.0 Asynchronous Application A Servlet 3.0 application using asychronous API.
Servlet 3.0 Dynamic Registration of Servlets and Filters Application A Servlet 3.0 application that features the dynamic registration of Servlets and Filters from a ServletContextListener.
Servlet 3.0 Multipart Application A Servlet 3.0 application that demonstrates multipart (a.k.a. file upload) support.
Servlet 3.0 Absolute Ordering Web Fragments Sample A Servlet 3.0 application that demonstrates web fragments with absolute ordering.
Access JAR-Bundled JSP Resource Sample An application that demonstrates how dynamic and static resources bundled inside the META-INF/resources directory of a JAR file inside the application's WEB-INF/lib directory may be accessed in the same way as if they had been placed in the application's document root.
Servlet 3.0 ServletContainerInitializer Sample An application that demonstrates how the ServletContainerInitializer feature can be used by libraries to register interest in certain types of applications and take whatever action as the library sees fit.
Programmatic Configuration of HTTP Session Cookies Sample An application that demonstrates the new programmatic configuration support for session cookies available with Servlet 3.0.
Web Services
Hello JAXWS Application An that application demonstrates how JAXWS 2.2 can generate artifacts dynamically and no use of wsgen is required when bundling and packing the artifacts.
EJB 3.1 Singleton Web Services Application An application that demonstrates a singleton EJB web service. It shows how easy it is to annotate a web service with @Singleton and develop clients for it.
Hello-WebServiceRef Application A JAX-WS Web Services sample that demonstrates the injecton of Web Service Client by the container through the use of @WebServiceRef and configuring WebService features like MTOM, addressing on such injected resource.
Java API for RESTful Web Services
Message Board Application An application that demonstrates the possibility to use no-interface EJB session beans as RESTful resource classes deployed as a servlet.
Managed Beans Application An application that demonstrates the possibility to annotate REST resource class with ManagedBean annotation, thus REST resource can be Managed Bean as well.
JSF 2.0
Basic AJAX Application A series of simple programs intended to illustrate some of the new Ajax features that are contained in JSF 2.0. 
Ajax Basic Composite Component Application A series of simple programs intended to illustrate some of the new Composite Component features that are contained in JSF 2.0.
Ajax Complete Application A series of simple programs intended to illustrate some of the new Ajax features that are contained in JSF 2.0.
Contexts & Dependency Injection (CDI)

JSF 2.0 Weld Application

An application that demonstrates the use of CDI with JSF 2.0.

Weld Servlet Application

An application that illustrates the injection of Weld into a servlet.
CDI Interceptors Application An application that illustrates CDI Interceptors to intercept and log method calls.
CDI Events Application An application that illustrates CDI events using producer and consumer EJBs.
Security
Programmatic Login Application A web application that demonstrates the programmatic security (login/logout) feature in Servlets 3.0.
HTTP Method Omissions Application A web application that demonstrates the use of http-method-omission feature of Servlet 3.0  to restrict the set of supported HTTP methods to just GET and POST.
Java EE Connector Architecture 1.6
MailConnector Resource Adapter Sample Application An application using the mail-connector resource-adapter to retrieve e-mails. Demonstrates how to use new annotations introduced in Java EE Connector Architecture 1.6 specification. The mail connector resource adapter is completely built by specifying annotations. No deployment descriptor is used.
Java Persistence API 2.0
JPA Pessimistic Locking Application An application that demonstrates the use of locking with Java Persistence APIs.
JPA Advanced Mapping Sample

An application that demonstrates the use of Derived Identities and Maps.

JPA Criteria Query Sample An application that demonstrates the use of Criteria Queries.
Container Features
Custom Valve Application An application that demonstrates the custom valve facilities available in GlassFish v3.
mod_jk Sample A sample that demonstrates running GlassFish v3 with Apache httpd.
Session Persistence
clusterjsp Simple JSP web application to demonstrate session persistence.


The Java EE 6 SDK can be downloaded from oracle.com/javaee. I recently added two CDI samples and will continue to add more. Let us know if you'd like to contribute your Java EE 6 samples here.

And if you find any samples broken then send us feedback or file bugs (use "sample_app" category).

About

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.


Java EE 7 Samples

Stay Connected

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today