0% found this document useful (0 votes)
48 views20 pages

Chapter 3243

This document is a comprehensive guide for the 'Enterprise Java' course as per the new syllabus of Mumbai University for B.Sc. - IT, Semester V. It includes detailed content on Java EE, Servlets, Java Server Pages, Enterprise Java Beans, and Hibernate, organized into five units with practical examples and exercises. The book is authored by several professors and is dedicated to their families and mentors, emphasizing the importance of support in their academic endeavors.

Uploaded by

wssupssup
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views20 pages

Chapter 3243

This document is a comprehensive guide for the 'Enterprise Java' course as per the new syllabus of Mumbai University for B.Sc. - IT, Semester V. It includes detailed content on Java EE, Servlets, Java Server Pages, Enterprise Java Beans, and Hibernate, organized into five units with practical examples and exercises. The book is authored by several professors and is dedicated to their families and mentors, emphasizing the importance of support in their academic endeavors.

Uploaded by

wssupssup
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Enterprise JAVA

(As Per the New Syllabus 2018-19 of Mumbai University for B.Sc. - IT, Semester V)

Prof. Kiran Gurbani


B.E., MCA, M.Phil.
Head of Computer Science and Information Technology Department,
R.K. Talreja College of Arts, Science and Commerce, Ulhasnagar (West).

Prof. Sandeep Vishwakarma Prof. Shaikh Ahtesham Arif


B.Sc. (IT) Co-ordinator, MCA, MBA (IS)
Chandrabhan Sharma College of Arts, Head of Department – IT
Science and Commerce, Anjuman-i-Islam's, Akbar Peerbhoy College,
Powai, Mumbai. Grant Road(E), Mumbai.

Prof. Gauravi Desai


M.Sc. Computer Science,
B.Sc.(IT), M.Sc(IT) Co-ordinator,
Wilson College,
Charni Road, Mumbai

ISO 9001:2015 CERTIFIED


© Authors
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any
means, electronic, mechanical, photocopying, recording and/or otherwise without the prior written permission of the
authors and the publisher.

First Edition : 2018

Published by : Mrs. Meena Pandey for Himalaya Publishing House Pvt. Ltd.,
“Ramdoot”, Dr. Bhalerao Marg, Girgaon, Mumbai - 400 004.
Phone: 022-23860170, 23863863; Fax: 022-23877178
E-mail: [email protected]; Website: www.himpub.com
Branch Offices :
New Delhi : “Pooja Apartments”, 4-B, Murari Lal Street, Ansari Road, Darya Ganj,
New Delhi - 110 002. Phone: 011-23270392, 23278631; Fax: 011-23256286
Nagpur : Kundanlal Chandak Industrial Estate, Ghat Road, Nagpur - 440 018.
Phone: 0712-2738731, 3296733; Telefax: 0712-2721216
Bengaluru : Plot No. 91-33, 2nd Main Road, Seshadripuram, Behind Nataraja Theatre,
Bengaluru - 560 020. Phone: 080-41138821;
Mobile: 09379847017, 09379847005
Hyderabad : No. 3-4-184, Lingampally, Besides Raghavendra Swamy Matham,
Kachiguda, Hyderabad - 500 027. Phone: 040-27560041, 27550139
Chennai : New No. 48/2, Old No. 28/2, Ground Floor, Sarangapani Street, T. Nagar,
Chennai - 600 012. Mobile: 09380460419
Pune : “Laksha” Apartment, First Floor, No. 527, Mehunpura,
Shaniwarpeth (Near Prabhat Theatre), Pune - 411 030.
Phone: 020-24496323, 24496333; Mobile: 09370579333
Lucknow : House No. 731, Shekhupura Colony, Near B.D. Convent School, Aliganj,
Lucknow - 226 022. Phone: 0522-4012353; Mobile: 09307501549
Ahmedabad : 114, “SHAIL”, 1st Floor, Opp. Madhu Sudan House, C.G. Road, Navrang
Pura, Ahmedabad - 380 009. Phone: 079-26560126; Mobile: 09377088847
Ernakulam : 39/176 (New No. 60/251), 1st Floor, Karikkamuri Road, Ernakulam,
Kochi - 682 011. Phone: 0484-2378012, 2378016; Mobile: 09387122121
Bhubaneswar : Plot No. 214/1342, Budheswari Colony, Behind Durga Mandap,
Bhubaneswar - 751 006. Phone: 0674-2575129; Mobile: 09338746007
Kolkata : 108/4, Beliaghata Main Road, Near ID Hospital, Opp. SBI Bank,
Kolkata - 700 010. Phone: 033-32449649; Mobile: 07439040301
DTP by : Bhakti S. Gaonkar
Printed at : M/s. Aditya Offset Process (I) Pvt. Ltd., Hyderabad. On behalf of HPH.
DEDICATION

First and foremost, I would like to thank God. In the process of putting this book together, I
realized how true this gift of writing is for me. You gave me the power to believe in my passion and
pursue my dreams.
I would like to dedicate this book to my Mom (Kavita S. Bajaj) and my son (Chirag Gurbani).
There is a reason my mom being whole and sole support towards my dedication, she is such an
identity who makes me rise each and every moment.
Finally, I would like to take this opportunity to express my deep sense of gratitude for lifetime to
a special person Mr. S.K. Srivastava of Himalaya Publishing House Pvt. Ltd. for his valuable
guidance, constant encouragement, immense motivation and new positivity in my life that has
appeared as a gift which is sent from God and he left figureprints of grace in my life. Really, I am
sincerely grateful to him for sharing his truthful and illuminating views which has motivated
throughout to write such fantastic content. Last but not Least would Like to Thanks to whole
Himalaya Production Team mainly to Archana maam for her great support
Prof. Kiran Gurbani

I would like to dedicate this book to my mother and father Mrs. Savitri Devi and (Late) Shri Jai
Prakash Vishwakarma. I would like to thank my wife Mrs. Archana for motivating me to write the
book. Special thanks to my son Himanshu and Priyanshu who always ask about Enterprise Java Book
I would like to thank all my family members for their support.
I am also grateful to my principal Mrs. Pratima Singh for motivation and encouragement.
Special thanks to my colleague Mr. Nitesh Shukla for completing the Enterprise Java Book.
Prof. Sandeep Vishwakarma

I Would like to dedicate this book to my mother, Anjum Shaikh – My first teacher
and
father, Arif Shaikh – my best teacher and mentor.
Prof. Shaikh Ahtesham Arif

"This book is dedicated to my Grandmother,


who's
been a rock of stability throughout our lives".
Prof. Gauravi Desai
PREFACE
The evolution of advanced object oriented programming language such as C++ and Java
has provided very effective and efficient programming tools. Specially, Java can be used for
implementing Windows and Web Application concepts. Due to increasing popularity of Java as
a prominent programming language for implementing advanced features, University of
Mumbai has included “Enterprise Java” in its Revised Syllabus of T.Y.B.Sc. (IT), Semester V.
This book has been designed as per new revised syllabus of T.Y.B.Sc. (IT), Mumbai
University. This book incorporates advanced concepts of Web applications and services of Java
Programming. This book includes all the related topics with variety of examples which is
understandable to students.
This book is organised in 5 units.
Unit 1 contains six chapters which covers Understanding Java EE, Java EE Architecture,
Server and Containers, Introduction to Java Servlets, Servlet API and Life Cycle, Working with
Servlets, Working with Database.
Unit 2 contains five chapters which covers Request Dispatcher, Cookies, Sessions,
Working with Files, Working with Non-blocking I/O.
Unit 3 contains five chapters which covers Introduction to Java Server Pages, Getting
Started with Java Server Pages, Actions, Elements, Implicit Objects, Scope and EI Expressions,
Java Server Pages and Standard Tag Libraries.
Unit 4 contains five chapters. Introduction to Enterprise Java Beans, Working with
Session Beans, Working with Message Driven Beans, Interceptors, Java Naming and Directory
Interface.
Unit 5 contains five chapters which covers Persistence, Object/Relational Mapping and
JPA, Introduction to Java Persistence API, Writing JPA Application, Introduction to Hibernate
and Writing Hibernate Application.
This book also covers all the University practical with proper example.
All necessary care has been taken to avoid mistakes and misprints in the book. Any
suggestions to improve the utility of the book will be gladly accepted. You can send your
suggestion on [email protected], [email protected],
[email protected] and [email protected]
Authors
SYLLABUS
Sr. No. Modules/Units
I Understanding Java EE
What is an Enterprise Application?, What is Java Enterprise Edition?, Java EE Technologies,
Java EE Evolution, Glassfish Server
Java EE Architecture, Server and Containers
Types of System Architecture, Java EE Server, Java EE Containers
Introduction to Java Servlets
The Need for Dynamic Content, Java Servlet Technology, Why Servlets?, What can Servlets
do?
Servlet API and Life Cycle
Java Servlet API, The Servlet Skeleton, The Servlet Life Cycle, A Simple Welcome Servlet
Working with Servlets
Getting Started, Using Annotations Instead of Deployment Descriptor
Working with Database
What is JDBC?, JDBC Architecture, Acessing Database, The Servlet GUI and Database
Example
II RequestDispatcher
RequestDispatcher Interface, Methods of Requestdispatcher , Requestdispatcher Application
Cookies
Kinds of Cookies, Where Cookies are Used?, Creating Cookies using Servlet, Dynamically
Changing the Colours of a Page
Sessions
What are Sessions?, Life cycle of Http Session, Session Tracking with Servlet API, A Servlet
Session Example
Working with Files
Uploading Files, Creating an Upload File Application, Downloading Files, Creating a
Download File Application
Working with Non-blocking I/O
Creating a Non-blocking Read Application, Creating the Web Application, Creating Java
Class, Creating Servlet, Retrieving the File, Creating index.jsp
III Introduction to Java Server Pages
Why Use Java Server Pages?, Disadvantages of JSP, JSP v/s Servlets, Life Cycle of a JSP
Page, How Does a JSP Function?, How Does JSP Execute?, About Java Server Pages
Getting Started with Java Server Pages
Comments, JSP Document, JSP Elements, JSP GUI Example
Actions Elements
Including Other Files, Forwarding JSP Page to Another Page, Passing Parameters for Other
Actions, Loading a Javabean
Implicit Objects, Scope and EI Expressions
Implicit Objects, Character Quoting Conventions, Unified Expression Language (Unified EI),
Expression Language
Java Server Pages Standard Tag Libraries
What is Wrong in Using JSP Scriptlet Tags?, How JSTL Fixes JSP Scriptlet’s Shortcomings?,
Disadvantages of JSTL, Tage Libraries
IV Introduction to Enterprise JavaBeans
Enterprise Bean Architecture, Benefits of Enterprise Bean, Types of Enterprise Bean,
Accessing Enterprise Beans, Enterprise Bean Application, Packaging Enterprise Beans
Working with Session Beans
When to Use Session Beans?, Types of Session Beans, Remote and Local Interfaces,
Accessing Interfaces, Life cycle of Enterprise Beans, Packaging Enterprise Beans, Example
of Stateless Session Bean, Example of Stateful Session Bean, Example of Singleton Session
Bean
Working with Message-driven Beans
Life cycle of a Message-driven Bean, Uses of Message-driven Beans, The Message-driven
Beans Example
Interceptors
Request and Interceptor, Defining an Interceptor, AroundInvoke Method, Applying
Interceptor, Adding an Interceptor to an Enterprise Bean, Build and Run the Web Application
Java Naming and Directory Interface
What is Naming Service?, What is Directory Service?, What is Java Naming and Directory
Interface?, Basic Lookup, JNDI Namespace in Java EE, Resources and JNDI, Datasource
Resource Definition in Java EE
V Persistence, Object/Relational Mapping and JPA
What is Persistence?, Persistence in Java, Current Persistence Standards in Java, Why
Another Persistence Standards?, Object/Relational Mapping
Introduction to Java Persistence API
The Java Persistence API, JPA, ORM, Database and the Application, Architecture of JPA,
How JPA Works?, JPA Specification
Writing JPA Application
Application Requirement Specifications, Software Requirements, The Application
Development Approach, Creating Database and Tables in MySQL, Creating a Web
Application, Adding the Required Library Files, Creating a Javabean Class, Creating
Persistence Unit [Persistence.XML], Creating JSPS, The JPA Application Structure, Running
the JPA Application
Introduction to Hibernate
What is Hibernate?, Why Hibernate?, Hibernate, Database and the Application, Components
of Hibernate, Architecture of Hibernate, How Hibernate Works?
Writing Hibernate Application
Application Requirement Specifications, Software Requirements, The Application
Development Approach, Creating Database and Tables in MySQL, Creating a Web
Application, Adding the Required Library Files, Creating a Javabean Class, Creating
Hibernate Configuration File, Adding a Mapping Class, Creating JSPS, Running The
Hibernate Application
QUESTION PAPER PATTERN

Maximum Marks: 75 Duration: 2 ½ Hours


Q.1. Attempt any three of the following: (15)
(a)
(b)
(c)
(d)
(e)
(f)
Q.2. Attempt any three of the following: (15)
(a)
(b)
(c)
(d)
(e)
(f)
Q.3. Attempt any three of the following: (15)
(a)
(b)
(c)
(d)
(e)
(f)
Q.4. Attempt any three of the following: (15)
(a)
(b)
(c)
(d)
(e)
(f)
Q.5. Attempt any three of the following: (15)
(a)
(b)
(c)
(d)
(e)
(f)
CONTENTS

Sr. No. Modules/Units Page No.


Unit - I
1 Understanding Java EE 1 – 10
2 Java EE Architecture, Server and Containers 11 – 19
3 Introduction to Java Servlets 20 – 26
4 Servlet API and Life cycle 27 – 42
5 Working with Servlets 43 – 57
6 Working with Database 58 – 75
Unit - II
7 RequestDispatcher 76 – 79
8 Cookies 80 – 86
9 Sessions 87 – 95
10 Working with Files 96 – 113
11 Working with Non-blocking I/O 114 – 133
Unit - III
12 Introduction to Java Server Pages 134 – 147
13 Getting Started with Java Server Pages 148 – 171
14 Actions Elements 172 – 178
15 Implicit Objects, Scope and EI Expressions 179 – 188
16 Java Server Pages Standard Tag Libraries 189 – 209
Unit - IV

17 Introduction to Enterprise JavaBeans 210 – 219

18 Working with Session Beans 220 – 233

19 Working with Message-driven Beans 234 – 236

20 Interceptors 237 – 245

21 Java Naming and Directory Interface 246 – 251


Unit - V

22 Persistence, Object/Relational Mapping and JPA 252 – 259

23 Introduction to Java Persistence API 260 – 265

24 Writing JPA Application 266 – 282

25 Introduction to Hibernate 283 – 290

26 Writing Hibernate Application 291 – 298

Practicals 299 – 372


Unit - I

Chapter
Understanding
1 Java EE

Chapter Outline
1.1 What is an Enterprise Application?
1.2 Architecture of an Enterprise Application
1.3 What is Java Enterprise Edition?
1.4 Java EE Technologies
1.5 Java EE Evolution
1.6 Glassfish Server
1.7 Chapter Based Questions

1.1 What is an Enterprise Application?


 The Java EE platform is designed to help developers create large-scale, multi-tiered,
scalable, reliable, and secure network applications. A shorthand name for such applications
is “enterprise applications,” so called because these applications are designed to solve the
problems encountered by large enterprises.
 Enterprise applications are not only useful for large corporations, agencies, and governments,
however.
 The benefits of an enterprise application are helpful, even essential, for individual
developers and small organizations in an increasingly networked world.
 The features that make enterprise applications powerful, like security and reliability, often
make these applications complex.
 The Java EE platform reduces the complexity of enterprise application development by
providing a development model, API, and runtime environment that allow developers to
concentrate on functionality.
 Enterprise as work means communities and organizations. Therefore we can say enterprise
applications respond to the requirements of organizations, enterprise problems and focuses
these.
2 Enterprise JAVA

The common features of enterprise Application:


1. Extreme amount of data
2. Complicated data relations
3. Specific business domain
4. Distributed systems and integration with other systems
5. Concurrent access
6. Multiple interface for user group

1.2 Architecture of an Enterprise Application


 Architecture is the extension of the concept of multi-tier architecture and available
technologies resulting in a custom made platform that can run across hardware and software
framework found across an enterprise, often spanning geographical boundaries.
 A distributed, multi-tiered, application model can be described as an enterprise application.
 Application logic is divided into components according to functions and the various
application components put together make up the enterprise application.
 These components are physically installed on different computers, at different physical
locations, depending on the tier in the multi-tiered environment to which the application
component belongs. All components work together in harmony across the enterprise.
Enterprises architecture is divided into the following tiers:
1. Client Tier Services run on the client machine
2. Web Tier Services run on the server
3. Business Tier Services run on the server
4. Enterprise Information System Tier Software run on the EIS server

1.3 What is Java Enterprise Edition?


 Java EE is a set of coordinated technologies and practices that enable developing,
deploying managing multi-tier Server centric enterprise applications.
 It is a collection of standardized components, containers and services for creating and
deploying distributed applications within a well-defined distributed computing architecture.
 Java Enterprise Edition has brought in a powerful set of APIs that has helped the developers
not only reduce the development time and the application complexity but also the
application performance.
 Commercial applications that have to function at this level do not run on a single PC as they
require significantly more computing power and throughput than what a single PC can provide.
 Commercial application is normally sectioned into functional segments, each such found to
a specific Master or Child business process at a specific location, then on appropriate
hardware platform(s) at that location.
 Finally, the business data generated and manipulated at that location would be streamed and
into one central point say for example Enterprise headquarters. This is the essence
distributed computing.
Understanding Java EE 3

 Java EE provides a collection of:


 Startdardized components that facilitate the crafting of such commercial applications
 Standard interfaces that define how the various application modules interconnect
 Standard services that define how the different software modules communicate
 Java EE significantly reduces the cost and complexity of developing and deploying
multi-tier solutions, resulting in services that can be rapidly deployed and easily enhanced.

1.4 Java EE Technologies


It can be classified into different categories as follows:
1. Web Application Technologies
 Java Servlet
 JavaServer Pages Technology
 JavaServer Pages Standard Tag Library
 JavaServer Faces Technology
 Java Message Service API
 JavaMail API and the JavaBeans Activation Framework
 Java API for XML Processing
 Java Naming and Directory Interface
2. Enterprises Application Technologies
 Contexts and Dependency Injection for Java (Web Beans)
 Dependency Injection for Java 1.0
 Bean Validation
 Enterprise JavaBeans
 Java EE Connector Architecture
 Java Persistence API
 Common Annotations for the Java Platform
 Java Message Service API
 Java Transaction API (JTA)
 JavaBeans Activation Framework (JAF)
 JavaMail
3. Java EE Web Services Technologies
 Java API for RESTful Web Services (JAX-RS)
 Implementing Enterprise Web Services
 Java API for XML-Based Web Services (JAX-WS)
 Java Architecture for XML Binding (JAXB)
 Web Services Metadata for the Java Platform
 Java API for XML-Based RPC (JAX-RPC)
 Java APIs for XML Messaging [or SOAP with Attachments API for Java (SAAJ)]
 Java API for XML Registries (JAXR)
 Streaming API for XML (StAX) (in Java SE)
4 Enterprise JAVA

4. Java EE Management and Security Technologies


 Java Authentication Service Provider Interface for Containers
 Java Authorization Contract for Containers
 Java EE Application Deployment
 J2EE Management
Here we are going to explain few of the famous technologies of Java EE from each category
which is listed above.

1. Web Application Technologies


 Java Servlet API: The Java Servlet runs on the server side without an application of its own as
HTML user interface (UI) or an application GUI. They are used to extend the applications
hosted by the web servers. Several web applications are developed with Java Servlet extensions.
 JavaServer Pages Technology: It gives the simple and fast way to create the dynamic
content. It facilitates the addition of snippets of servlet code into the text-based document.
 JavaServer Pages Standard Tag Library: It has the iterator and conditional tags to handle
flow control, tags for accessing databases with SQL, manipulate XML documents,
internalization, and commonly used functions.
 JavaServer Faces Technology: It forms the UI framework to build web applications.
 Java Message Service API: The combination of Java technology with enterprise messaging,
the JMS API forms the powerful tool to solve the enterprise computing problems.
 JavaMail API and the JavaBeans Activation Framework: It is used to send e-mail
notifications. In conjunction, one may use the JavaBeans Activation Framework (JAF) API,
which determines the type of data, encapsulate the access, and discover the operations available.
 Java API for XML Processing: It is flexible and JAXP facilitate the use of any XML-
compliant parser or the XSL processor within the application and supports the W3C schema.
 Java Naming and Directory Interface: It provides the functionality of naming and
directory, enable the applications to access several naming and directory services.

2. Enterprises Application Technologies


 Contexts and Dependency Injection for Java (Web Beans): This specification unifies the
JavaServer Faces (JSF)-managed bean component model with the Enterprise JavaBeans
(EJB) component model to simplify the programming model for web-based applications.
 Enterprise JavaBeans: Enterprise JavaBeans (EJB) technology is the server-side
component architecture for the Java Platform, Enterprise Edition (Java EE). EJB technology
enables rapid and simplified development of distributed, transactional, secure and portable
applications based on Java technology. The Java Persistence API, which provides a POJO
persistence model for object-relational mapping, is also part of JSR 220, although its use is
not limited to EJB software components.
 Java Persistence API: The Java Persistence API provides a POJO persistence model for
object-relational mapping. The Java Persistence API was developed by the EJB 3.0 software
expert group as part of JSR 220, but its use is not limited to EJB software components. It
can also be used directly by web applications and application clients, and even outside the
Understanding Java EE 5

Java EE platform, for example, in Java SE applications. The Java Data Objects (JDO) API is
another standard for Java persistence, developed under the Java Community Process.
 Java Message Service API: The Java Message Service (JMS) API is a messaging standard
that allows application components based on the Java 2 Platform, Enterprise Edition (J2EE)
to create, send, receive, and read messages. It enables distributed communication that is
loosely coupled, reliable, and asynchronous.
 Java Transaction API (JTA): JTA specifies standard Java interfaces between a transaction
manager and the parties involved in a distributed transaction system: the resource manager,
the application server, and the transactional applications. The JTA specification was
developed by Sun Microsystems in cooperation with leading industry partners in the
transaction processing and database system arena.

3. Java EE Web Services Technologies


 Java API for RESTful Web Services (JAX-RS): Java API for RESTful Web Services
(JAX-RSJ defines APIs for the development of web services built according to the
Representational State Transfer IRFSTI architectural style.
 Java API for XML-Based Web Services (JAX-WS): It provides support for web services
using the SOAP/HTTP protocol.
 Java API for XML Registries (JAXR): The JAXR API provides a set of distributed
registry services that enables business-to-business integration.

4. Java EE Management and Security Technologies


 Java Authentication Service Provider Interface for Containers: To define a standard
interface by which authentication modules may be integrated with containers such that these
modules may establish the authentication identities used by containers.
 Java Authorization Contract for Containers: The Java Authorization Contract for
Containers (Java ACC) specification defines new java.security.Permission classes to satisfy
the Java 2 Platform, Enterprise Edition (J2EE) authorization model. The Java ACC
specification defines the binding of container access decisions to operations on instances of
these permission classes. It defines the semantics of policy providers that employ the new
permission classes to address the authorization requirements of J2EE.

1.5 Java EE Evaluation


1. Java EE5
2. Java EE6
3. Java EE7

1. Java EE5
 It is introduced in May 11, 2006 by Oracle.
 The aim of the Java EE 5 platform is to provide developers a powerful set of APIs while
reducing development time, reducing application complexity, and improving application
performance.
6 Enterprise JAVA

Java EE 5 SDK Features


1. First robust, commercial, compatible Java EE 5 implementation. It is free for development,
deployment, and redistribution.
2. Ease of development with major revamp of programming model.
3. EJB 3.0 support for POJOs means less to learn, less to code, and less to maintain.
4. New Java Persistence API makes object-relational mapping cleaner and easier.
5. New and updated web services (JAX-WS 2.0 and JAXB 2.0) simplifies SOA implementation.
6. JavaServer Faces 1.2 facilitates building Web 2.0 applications with Ajax.
7. Higher throughput, faster response time, and improved management features to streamline
deployment.
8. 30 percent faster startup time with 30 percent less memory
9. Web services performance increased by up to 5 times.
10. Improved web services management.
11. Integrated with Sun’s NetBeans open source IDE and supports an Eclipse plug-in, offering
developers the choice of complete end-to-end development and runtime environment.
12. Provides a visual SOA development and deployment environment with integrated NetBeans
environment.
13. Integrated composite application support through JBI and BPEL
14. The code for Sun GlassFish Enterprise Server v2.1.1 is 100 percent derived from open-
source Project GlassFish.

2. Java EE6
 It is introduced in December 10, 2009.
 The most important goal of the Java EE 6 platform is to simplify development by providing
a common foundation for the various kinds of components in the Java EE platform.
 Developers benefit from productivity improvements with more annotations and less XML
configuration, more Plain Old Java Objects (POJOs), and simplified packaging.
Features of Java EE6
1. Profiles: configurations of the Java EE platform targeted at specific classes of applications.
Specifically, the Java EE 6 platform introduces a lightweight Web Profile targeted at next-
generation web applications, as well as a Full Profile that contains all Java EE technologies
and provides the full power of the Java EE 6 platform for enterprise applications.
2. New technologies, including the following:
(a) Java API for RESTful Web Services (JAX-RS)
(b) Managed Beans
(c) Contexts and Dependency Injection for the Java EE Platform (JSR 299), informally
known as CDI
(d) Dependency Injection for Java (JSR 330)
(e) Bean Validation (JSR 303)
(f) Java Authentication Service Provider Interface for Containers (JASPIC)
Understanding Java EE 7

New features for Enterprise JavaBeans (EJB) Components


1. An Enterprise JavaBeans (EJB) component, or enterprise bean, is a body of code having
fields and methods to implement modules of business logic. You can think of an enterprise
bean as a building block that can be used alone or with other enterprise beans to execute
business logic on the Java EE server.
2. In the Java EE 6 platform, new enterprise bean features include the following:
(a) The ability to package local enterprise beans in a WAR file
(b) Singleton session beans, which provide easy access to shared state
(c) A lightweight subset of Enterprise JavaBeans functionality (EJB Lite) that can be
provided within Java EE Profiles, such as the Java EE Web Profile.
3. The Java EE 6 platform requires Enterprise JavaBeans 3.1 and Interceptors 1.1. The
Interceptors specification, which is part of the EJB 3.1 specification, makes more generally
available the interceptor facility originally defined as part of the EJB 3.0 specification.
New Features for Servlets
1. Java Servlet technology lets you define HTTP-specific servlet classes. A servlet class
extends the capabilities of servers that host applications accessed by way of a request-
response programming model. Although servlets can respond to any type of request, they
are commonly used to extend the applications hosted by web servers.
2. In the Java EE 6 platform, new Java Servlet technology features include the following:
(a) Annotation support
(b) Asynchronous support
(c) Ease of configuration
(d) Enhancements to existing APIs
(e) Pluggability
3. The Java EE 6 platform requires Servlet 3.0.
New Features for JavaServer Faces Components
1. JavaServer Faces technology is a user interface framework for building web applications.
The main components of JavaServer Faces technology are as follows:
2. A GUI component framework.
3. A flexible model for rendering components in different kinds of HTML or different markup
languages and technologies. A Renderer object generates the markup to render the component
and converts the data stored in a model object to types that can be represented in a view.
4. A standard RenderKit for generating HTML/4.01 markup.
5. The following features support the GUI components:
(a) Input validation
(b) Event handling
(c) Data conversion between model objects and components
(d) Managed model object creation
(e) Page navigation configuration
(f) Expression Language (EL)
8 Enterprise JAVA

(g) All this functionality is available using standard Java APIs and XML-based
configuration files.
6. In the Java EE 6 platform, new features of JavaServer Faces include the following:
(a) The ability to use annotations instead of a configuration file to specify managed beans
and other components
(b) Facelets, a display technology that replaces JavaServer Pages (JSP) technology using
XHTML files
(c) Ajax support
(d) Composite components
(e) Implicit navigation
7. The Java EE 6 platform requires JavaServer Faces 2.0 and Expression Language 2.2.

Java EE7
 This technology is introduced in May 28, 2013.
 The most important goal of the Java EE 7 platform is to simplify development by providing
a common foundation for the various kinds of components in the Java EE platform.
Developers benefit from productivity improvements with more annotations and less XML
configuration, more Plain Old Java Objects (POJOs), and simplified packaging.
The Java EE 7 Platform includes the following New Features
1. New technologies, including the following:
(a) Batch Applications for the Java Platform
(b) Concurrency Utilities for Java EE
(c) Java API for JSON Processing (JSON-P)
(d) Java API for WebSocket
2. Implement the new Java API for Batch Applications, JSON and Websocket in your code
(JSRs 352, 353 and 356).
3. Enable JAX-RS 2.0, EL 3.0 and JMS 2.0 Major enhancements in your code.
4. Implement the enhancements in JSF and JSP in your code.
5. Implement the enhancements in CDI and Bean Validation in your code.
6. Implement the enhancements in EJB and JPA in your code.
7. Describe and leverage the enhancements in the Java EE 7 platform.
8. Understand the new features for Java EE 7: JSON, WebSockets, HTML 5, JSF & Servlets.
9. Update existing applications to EE 7
10. Write applications for Java EE 7 and take advantage of the benefits of a cloud environment
and of the Java EE 7 improved simplification. Extend the range of the Java EE platform to
encompass emerging technologies in the web space.

1.6 Glassfish Server


 GlassFish is a Java application server project created by Sun Microsystems that allows many
developers to generate enterprise technologies that are convenient and scalable, as well as
additional services that can be installed based on preference.
Understanding Java EE 9

 GlassFish Server Open Source Edition is an open source application server built within the
GlassFish community.
 Oracle GlassFish Server is based on GlassFish Server Open Source Edition.
 GlassFish Server users benefit from a vibrant community that offers self-support,
contributes code and product features, product ideas and feedback, bug reports, and more.
 It is a free, dual-licensed software under the GNU General Public License (GPL) and the
Common Development and Distribution License (CDDL). GlassFish was acquired by
Oracle in 2010.
 GlassFish was developed based on a source code that was released by Sun and Oracle’s
TopLink persistence system.
 The project was launched in 2005 and the first version that supported Java EE 5 was
released in 2006.
 The reference implementation of Java EE is GlassFish, so it supports JMS, JavaServer Pages,
Enterprise JavaBeans, RMI, JPA and servlets. Because of its nature, developers can create
scalable and portable applications that easily integrate with legacy systems and technologies.
 Oracle GlassFish Server provides a server for the development and deployment of Java
Platform, Enterprise Edition (Java EE platform) applications and web technologies based on
Java technology.
 GlassFish Server 3.1 provides the following:
 A lightweight and extensible core based on OSGi (Open Service Gateway Initiative)
Alliance standards
 A web container
 An easy-to-use Administration Console for configuration and management
 Update Tool connectivity for updates and add-on components
 Support for high availability clustering and load balancing

Features and Resources


 GlassFish Server 4.1 provides a server for the development and preparation of Java ™
Platform Enterprise Edition (Java EE) and dynamic and scalable HTML5 applications.
 Key features include applied science Java seven compatibility, modularity, and rapid
repetitive development.
Main Features
 GlassFish Server supports Java EE seven, which provides the basis for delivering dynamic
and scalable hypertext language applications.
 For example, the Java API for WebSocket allows bidirectional low-latency communication.
 The Java API for JSON processing simplifies information analysis for transportable
applications. The Java API for RESTful Net Services two.0, the performance utilities for
Java EE and Servlet 3.1 add competency options to change extremely scalable applications
to handle additional HTML5 buyers at the same time.
Java EE seven and GlassFish Server four.1 embrace the following new and updated Java
applied science standards:
10 Enterprise JAVA

 New or Significant Updates


 Java API for processing JSON (JSON-P)
 Java API for WebSocket Batch application for Java platform
 Java EE Competency Utilities
 Java Message Service (JMS) 2.0
 Java API for RESTful Net Services (JAX-RS)
Updated
1. Enterprise Java Beans (EJB) 3.2
2. Contexts and Dependency Injection for Java EE (CDI) one.2
3. Java Persistence API (JPA) 2.1
4. Java Server Faces (JSF) 2.2
5. Java Servlet 3.1
6. Bean Validation (BV) 1.1
7. Language of expression (EL) 3.0
8. Interceptors 1.0
9. Java Transaction (JTA) one.2
10. Java Server Pages (JSP) 2.3
11. JavaMail 1.5
Modularity
1. The modular design of GlassFish Server is based primarily on the standards of the OSGi
Alliance and ensures that the GlassFish Server only starts with the modules than the square
footage required for applications that only measures the measurement.
2. As a result, the boot times and the memory consumption decrease.
3. There are lots of his services available as freelance services.
Fast Repetitive Development
1. Using fashion days, such as NetBeans and Eclipse, the web application development cycle is
simplified for the browser-edit-save-update.
2. The GlassFish server allows such a simple development cycle for protocol session data
protection communication when an existing application is redistributed.

1.7 Chapter Based Questions


1. Explain Enterprise application of java and its architecture.
2. Write short notes on java enterprise edition.
3. Explain java enterprise application technologies.
4. Write short notes on Java EE Evolution.
5. Explain Glass fish server and its use.



You might also like