Copying the code from glassfish-samples