Java EE 5 Development using GlassFish Application Server 1st Ed. Edition David Heffelfinger download
Java EE 5 Development using GlassFish Application Server 1st Ed. Edition David Heffelfinger download
https://ebookultra.com/download/java-ee-5-development-using-
glassfish-application-server-1st-ed-edition-david-heffelfinger/
https://ebookultra.com/download/java-ee-5-development-with-
netbeans-6-1st-edition-heffelfinger/
https://ebookultra.com/download/websphere-solution-guide-websphere-
application-server-express-version-5-0-1st-ed-edition-rufus-credle/
https://ebookultra.com/download/websphere-application-server-
administration-using-jython-1st-edition-robert-a-gibson/
https://ebookultra.com/download/java-2-micro-edition-application-
development-michael-kroll/
Java EE 7 Essentials 1st Edition Arun Gupta
https://ebookultra.com/download/java-ee-7-essentials-1st-edition-arun-
gupta/
https://ebookultra.com/download/secure-java-for-web-application-
development-1st-edition-abhay-bhargav/
https://ebookultra.com/download/web-application-development-with-r-
using-shiny-beeley/
https://ebookultra.com/download/java-ee-7-for-beginners-1st-edition-
sharanam-shah/
https://ebookultra.com/download/java-tm-application-development-on-
linux-r-1st-edition-carl-albing/
Java EE 5 Development using GlassFish Application
Server 1st Ed. Edition David Heffelfinger Digital Instant
Download
Author(s): David Heffelfinger
ISBN(s): 9781847192615, 1847192610
Edition: 1st Ed.
File Details: PDF, 12.51 MB
Year: 2007
Language: english
Java EE 5 Development using
GlassFish Application Server
David R. Heffelfinger
BIRMINGHAM - MUMBAI
Java EE 5 Development using GlassFish
Application Server
The complete guide to installing and configuring the GlassFish
Application Server and developing Java EE 5 applications to be
deployed to this server
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of
the information presented. However, the information contained in this book is sold
without warranty, either express or implied. Neither the author, Packt Publishing,
nor its dealers or distributors will be held liable for any damages caused or alleged to
be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-847192-60-8
www.packtpub.com
Reviewers Indexer
Meenakshi Verma Monica Ajmera
Kim Mark Lewis
Proofreader
Acquisition Editor Chris Smith
Priyanka Baruah
Production Coordinator
Technical Editor Shantanu Zagade
Ajay.S
Cover Designer
Editorial Manager Shantanu Zagade
Dipali Chittar
Project Manager
Patricia Weir
About the Author
I would also like to thank the Packt Publishing staff for their help
and support in getting this book published. I am especially grateful
to Priyanka Baruah, who first contacted me regarding this book,
Patricia Weir for her patience regarding the several changes to the
book's outline, Sagara Naik for keeping track of the schedule. I
would also like to thank the technical reviewers, Kim Lewis and
Meenakshi Verma for providing excellent suggestions. Last but not
least, I would also like to thank Douglas Paterson, who gave me the
opportunity to get my first book published (and who wished to
work on a second book with me) for supporting my decision to work
on this book.
About the Reviewers
Meenakshi Verma has more than nine years of experience in Analysis, Design,
Development, and Implementation of stand-alone and web-based applications using
various languages like Java-based technologies, C, and BBx. She is proficient in
developing applications using J2EE technologies.
Meenakshi has also done the technical review of the Packt book titled Jasper Reports
for Java Developers by David Heffelfinger.
Kim Mark Lewis has been a consultant since 1991 to the US Federal Government,
working on financial and human resource systems for a variety of agencies such
as NASA, the Federal Communications Commission, the Federal Reserve Board,
the Department of the Army, and the Department of the Navy. Kim divides his
professional programming life between Java and .NET. He is married and has one
daughter and is currently living in the Washington D.C. area.
Table of Contents
Preface 1
Chapter 1: Getting Started with GlassFish 5
Overview of Java EE and GlassFish 5
GlassFish Advantages 6
Obtaining GlassFish 7
Installing GlassFish 8
GlassFish Dependencies 8
Performing the Installation 8
Verifying the Installation 10
Deploying Our First Java EE Application 12
Deploying an Application through the Web Console 12
Undeploying an Application through the Web Console 17
Deploying an Application through the Command Line 19
Undeploying an Application through the Command Line 20
GlassFish Domains Explained 21
Creating Domains 21
Deleting Domains 23
Stopping a Domain 23
Setting Up Database Connectivity 24
Setting Up Connection Pools 24
Summary 31
Chapter 2: Servlet Development and Deployment 33
Writing Our First Servlet 34
Compiling the Servlet 36
Configuring the Servlet 37
Packaging the Web Application 38
Deploying the Web Application 40
Testing the Web Application 40
Processing HTML Forms 42
Table of Contents
[ ii ]
Table of Contents
[ iii ]
Table of Contents
<h:selectOneMenu> 218
<h:selectOneRadio> 218
Additional JSF Tag Libraries 218
Summary 219
Chapter 7: Java Messaging Service 221
Setting Up GlassFish for JMS 221
Setting Up a JMS Connection Factory 221
Setting Up a JMS Message Queue 226
Setting Up a JMS Message Topic 227
Message Queues 228
Sending Messages to a Message Queue 228
Retrieving Messages from a Message Queue 232
Asynchronously Receiving Messages from a Message Queue 234
Browsing Message Queues 237
Message Topics 239
Sending Messages to a Message Topic 239
Receiving Messages from a Message Topic 241
Creating Durable Subscribers 243
Summary 246
Chapter 8: Security 247
Security Realms 247
Predefined Security Realms 248
admin-realm 249
The file Realm 251
The certificate Realm 265
Defining Additional Realms 273
Defining Additional File Realms 273
Defining Additional Certificate Realms 274
Defining an LDAP Realm 275
Defining a Solaris Realm 276
Defining a JDBC Realm 277
Defining Custom Realms 283
Summary 289
Chapter 9: Enterprise JavaBeans 291
Session Beans 292
Simple Session Bean 292
A More Realistic Example 295
Invoking Session Beans from Web Applications 298
Message-Driven Beans 301
Transactions in Enterprise Java Beans 302
Container-Managed Transactions 302
Bean-Managed Transactions 306
[ iv ]
Table of Contents
[]
Preface
Project GlassFish was formally announced at the 2005 JavaOne conference. Version
one of the GlassFish application server was released to the public approximately
a year later, at the 2006 JavaOne conference. GlassFish version one became the
reference implementation for the Java EE 5 specification, and as such, was the first
available application server compliant with this specification.
While releasing the first available Java EE 5 application server was a tremendous
accomplishment, the first version of GlassFish lacked some enterprise features such
as clustering and High Availability. GlassFish version 2, released in September 2007,
added these and other enterprise features, in addition to other features such as an
enhanced web based administration console.
This book will guide you through the development and deployment of Java
EE 5-compliant application on GlassFish version 2. It also covers application
development using frameworks that build on top of the Java EE 5 specification,
including Facelets, Ajax4jsf, and Seam.
Chapter 2 covers how to develop server-side web applications using the Servlet API.
Chapter 3 explains how to develop web applications using JavaServer Pages (JSPs),
including how to develop and use JSP custom tags.
Chapter 5 explains how to use the JSP Standard Tag Library (JSTL) when developing
JavaServer Pages.
Chapter 6 covers how to develop applications using the JavaServer Faces (JSF)
component framework to build web applications.
Chapter 8 covers securing J2EE applications through the Java Authentication and
Authorization Service (JAAS).
Chapter 9 discusses how to develop Enterprise Java Beans that adhere to the
EJB 3 specification.
Chapter 10 explains how to develop and deploy web services that conform to the
JAX-WS 2.1 specification.
Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles, and an
explanation of their meaning.
There are three styles for code. Code words in text are shown as follows: "We can
include other contexts through the use of the include directive."
[]
Random documents with unrelated
content Scribd suggests to you:
lapse of years the precise wording of that Catnach composition has
probably been lost, and the version that exists, filled up by the
imperfections of tradition, may have had its dates and places
disturbed. In a printed form the ballad, seemingly, cannot be
obtained.
If the differences just shown be considered fatal to the
relationship between the sailor’s song and the vessel noticed in the
narrative, then Cherry’s very popular ballad belongs to the history of
the sappers and miners.
92. Served seven years in the Royal Marines. Enlisted in the corps
April 28, 1788, and was present in almost every action and capture
which took place in the West Indies up to the year of his decease,
which occurred at Barbadoes, July 14, 1810. Few non-commissioned
officers had a more stirring career, or greater chances, by his prizes,
employments, and successful speculations, of acquiring wealth.
Much he gained and much he spent. He had his horses and his
servants. Costly ornaments he wore with eastern profusion, and the
hilt of his rapier, and the mountings of his scabbard, were of silver.
Indeed it requires a couplet from Pope to do him anything like
justice.
99. ‘London Gazette,’ 23rd to 26th July, 1796; takes notice of the
private wounded, but not of the sergeant taken prisoner.
102. In the ‘London Gazette,’ 3rd to 6th June, 1797, the killed only
are noticed.
105. The extras were allowed the men to provide them with
bread, a pair of breeches once in two years, and a rosette; and to
pay the expense of making up their gaiters, and converting their
uniform coats, after a certain period, into jackets.
James Douglas,
John Levick,
Edward } Sergeants.
Watson,
Robt.
Hutchinson, } Corporals.
John Young,
Benj.
Roberts,William Lance-
Bain,Hugh } Corporals.
Kinnaird,
Captain Charles Holloway,
Commanding the Royal Military
Artificers, &c., at Woolwich.
110. This officer was “ordered to the West Indies with two
companies of the royal military artificers: himself and two of the
privates only escaped the baleful effects of the climate of St.
Domingo.”—United Service Journal, i., 1832, p. 142.
111. These were privates Adam Cowan and John Westo. The
former was at once appointed sergeant and conductor of stores to
Commissary Meek of the Ordnance. After delivering over the stores
of the department at Jamaica to a sergeant of Dutch emigrant
artillery, he returned to England, and was discharged with a pension
of 2s. 0½d. a-day in April, 1816.
117. The above particulars are chiefly taken from Dr. Wittman’s
‘Travels in Turkey,’ &c.
118. Sir John Jones, in his ‘Sieges,’ vol. ii., note 38, p. 389, 2nd
edit.
120. Some time before leaving the city, private Thomas Taylor,
royal military artificers, was, without any provocation, assaulted by a
Turk, who attempted to stab him with his yatikan. On a report of this
outrage being made to the Capitan Pacha, to whose retinue the Turk
belonged, he came to a resolution to have him decapitated. By the
mediation and entreaties of Lord Elgin, a mitigation of the
punishment ensued, and the Turk, after receiving fifty strokes of the
bastinado on the soles of his feet, was sentenced to twenty years'
imprisonment in the college of Pera, to learn the Arabic language.—
Dr. Wittman’s Turkey, p. 93.
121. Particulars for the most part obtained from Wittman’s ‘Travels
in Turkey,’ &c.
126. John Wallace. It is related of him that he was lost sight of for
many months, and his appearance at Woolwich gave rise to as much
surprise as his person to doubt. All traces of the original man had
worn away, and from the oddness of his dress, and peculiarity of his
manners, the task of recognition was rendered still more perplexing.
Eventually, satisfactory proofs of his identity being obtained, he was
again acknowledged and discharged on a pension of 1s. 6d. a-day,
his service in the corps having exceeded thirty-three years.
129. Ibid.
131. Ibid.
140. With fifty women and forty children! More than, in these
days, are permitted to accompany a battalion on foreign service.
146. Sir John Jones states, evidently by mistake, that the corps
was composed of thirty-two companies.—Journals of Sieges, ii., note
38, p. 389, 2nd edit.
156. ‘United Service Journal,’ ii., 1843, p. 110. ‘Jones’s Sieges,’ ii.,
note 38, p. 389, 2nd edit.
157. In the absence, on foreign duty, of Captain J. T. Jones, from
July, 1808, to January, 1809, Sub-Lieutenant John Eaves performed
the duties of adjutant to the corps with credit and efficiency.
158. In Jones’s ‘Sieges,’ vol. ii., p. 269, 2nd edit., the number,
including the sub-lieutenant, is shown as 261 only; at p. 415, the
total of all ranks is stated to be 276; but both strengths differ from
the actual force engaged.
160. Was left property to the amount of 4000l. and purchased his
discharge in 1810.
166. Ibid. p. 6.
169. Jones’s ‘Sieges,’ vol. i., p. 70, 2nd edit. ‘United Service
Journal,’ ii., 1831, p. 331.
175. He invented an engine for nipping lead shot, used for years
in the royal laboratory, but for which an impostor and spy, named De
Haine, received a reward of 500l. While filling the office of inspector
of ordnance stores, he made various improvements in the
mechanical and intrenching tools. He also detected many
extraordinary frauds in the deliveries made by contractors. In one
attempted imposition only, he saved the Government 2000l. He
designed and constructed a life-ladder, which was frequently used
with success at fires, and an ingenious mortar-mill which occasioned
a great saving of expense to the department. At Chatham he
invented many useful tools, implements, and apparatus, and his
services were repeatedly acknowledged in the order books of the
establishment.
179. Among the recruits at this period was Sir John Sinclair, Bart.,
who, on the 12th August, 1812, enlisted in the name of John Smith.
Through various misfortunes he was reduced from affluence to
poverty. Noticed by Colonel Pilkington, R.E., for his uniform good
conduct and attainments, he was promoted to the rank of second-
corporal, and provided with a quarter at the main-guard in the royal
arsenal. His lady sometimes visited him in all the pride of her
station, but his own rank was as yet unsuspected. From a comrade—
afterwards Sub-Lieutenant H. B. Mackenzie—he frequently borrowed
plain clothes to elude arrest in the streets, and invariably proceeded
to the Treasury by water to receive his allowance. He was at length
dogged to Woolwich, and, on the 31st August, 1813, being taken,
was thrown into the debtors' side of Newgate, from whence he was
removed to the Fleet Prison, where, for a year and a half he was
confined, and was then only released by an error in law. Thirteen
months' sickness and distress followed his release, during which time
he was supplied with means by an acquaintance of his earlier and
happier days. All the while the whereabouts of John Smith was
unknown, but, advised by his friend, he confessed himself a
deserter, and in imploring pardon and indemnity for past errors,
solicited to be received for life in the New South Wales Corps. The
pardon was granted, and being relieved from further service in the
sappers, he was again left at liberty to follow his own inclination.
181. Sir John Jones, by mistake, vol. ii. p. 390, makes the
alteration of the name of the corps antecedent to the creation of the
establishment at Chatham.
185. Sir John Jones, in his ‘Sieges,’ i. p. 130, 2nd edit., records, by
mistake, the arrival of the company on the 15th instead of the 19th
January.
205. Jones’s ‘Sieges,’ ii., p. 118, 2nd edit. As a reward for their
services, most of the men that belonged to the flotilla received a
guinea and a pair of shoes.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com