SlideShare a Scribd company logo
I M.Sc(CS)
Dr. T. C. Vijayaraghavan
Department of Computer Science, BIHER
 Servlet Overview
What is meant by a Servlet?
Background on the web
Servlet Life Cycle
 Tomcat web server
 A Simple Servlet
 Using Eclipse or Apache Net Beans IDE
 Servlet API
◦ The javax.servlet Package
Interface Description
Servlet Declares life cycle methods for a servlet
ServletConfig Allows servlets to get initialization parameters.
ServletContext Enables servlets to log events and access information
about their environment.
ServletRequest Used to read data from a client request.
ServletResponse Used to write data to a client response.
 Servlet API (continued…)
Class Description
GenericServlet Implements the Servlet and
ServletConfig interfaces.
ServletInputStream Encapsulates an input stream for
reading requests from a
client.
ServletOutputStream Encapsulates an output stream for
writing responses to a client.
ServletException Indicates a servlet error occurred.
UnavailableException Indicates a servlet is unavailable.
 Servlet API
◦ The javax.servlet.http Package
Interface Description
HttpServletRequest Enables servlets to read data from an HTTP request.
HttpServletResponse Enables servlets to write data to an HTTP response.
HttpSession Allows session data to be read and written.
 Servlet API (continued…)
Class Description
Cookie Allows state information to be stored on a client machine.
HttpServlet Provides methods to handle HTTP requests and responses.
Cookie: The Cookie class encapsulates a cookie.
A cookie is stored on a client and contains state information.
Cookies are valuable for tracking user activities.
 A cookie can save the user’s name, address,
and other information.
 The user does not need to enter this data
each time he or she visits the store.
 A servlet can write a cookie to a user’s
machine via the addCookie( ) method of the
 HttpServletResponse interface.
 The data for that cookie is then included in
the header of the HTTP response that is sent
to the browser.
Session Tracking using Servlets
Security issues
 Using JDBC in Servlets
◦ RDBMS
◦ Java’s JDBC API
◦ Uses Structured Query Language (SQL)
◦ Servlets are in the middle tier in the 3-tier
architecture for accessing databases.
Using JDBC in Servlets
 HTML to Servlet communication
 Java Object serialization: allows you to take any
object that implements the Serializable interface and
turn it into a sequence of bytes that can later be fully
restored to regenerate the original object. This is true
even across a network which means that the
serialization mechanism automatically compensates
for differnces in operating systems.
 Applets are small applications that are
accessed on an Internet server, transported
over the Internet automatically installed, and
run as part of a web document. After an
applet arrives on the client, it has limited
access to resources so that it can produce a
graphical user interface and run various
computations without introducing the risk of
viruses or breaching data integrity.
 Applet to Servlet communication.
 The software component developer
 The software component assembly model
 What is a Java Bean?
◦ A Java Bean is a software component that has been designed to be
reusable in a variety of different environments. There is no restriction on
the capability of a Bean. It may perform a simple function, such as
obtaining an inventory value, or a complex function, such as forecasting
the performance of a stock portfolio. A Bean may be visible to an end user.
One example of this is a button on a graphical user interface. A Bean may
also be invisible to a user. Software to decode a stream of multimedia
information in real time is an example of this type of building block.
Finally, a Bean may be designed to work autonomously on a user’s
workstation or to work in cooperation with a set of other distributed
components.
 Examples of Java Bean: Software to generate a
pie chart from a set of data points is an
example of a Bean that can execute locally.
However, a Bean that provides real-time price
information from a stock or commodities
exchange would need to work in cooperation
with other distributed software to obtain its
data.
 Advantages of Java Beans
◦ A Bean obtains all the benefits of Java’s “write-once, run-
anywhere” paradigm.
◦ The properties, events, and methods of a Bean that are
exposed to another application can be controlled.
◦ Auxiliary software can be provided to help configure a
Bean.
◦ The state of a Bean can be saved in persistent storage and
restored at a later time.
◦ A Bean may register to receive events from other objects
and can generate events that are sent to other objects.
 Developing Java Beans
 Notable Beans
 Using Infobus
 Glasgow developments
 Application builder tool
 Java Archive (JAR) file format: is a way to collect
a group of files into a single compressed file, just
like Zip. JAR files are cross-platform. They are
especially helpful when you deal with the
Internet. A JAR file consists of a single file
containing a collection of zipped files along with
a “manifest” file that describes them.
 Introspection
◦ This is the process of analyzing a Bean to determine its
capabilities. This is an essential feature of the Java Beans
API because it allows another application, such as a design
tool, to obtain information about a component. Without
introspection, the Java Beans technology could not operate.
 Bound properties
◦ A Bean that has a bound property generates an event when
the property is changed.
 Constrained properties
◦ A Bean that has a constrained property generates an event
when an attempt is made to change its value.
 Persistence
◦ Persistence is the ability to save the current state of a Bean,
including the values of a Bean’s properties and instance
variables, to nonvolatile storage and to retrieve them at a
later time. The object serialization capabilities provided by
the Java class libraries are used to provide persistence for
Beans.
 Customizers
◦ A Bean developer can provide a customizer that
helps another developer configure the Bean. A
customizer can provide a step-by-step guide
through the process that must be followed to use
the component in a specific context. Online
documentation can also be provided. A Bean
developer has great flexibility to develop a
customizer that can differentiate his or her
product in the marketplace.
 Java Beans API: some important classes
◦ Introspector
◦ PropertyDescriptor
◦ EventSetDescriptor
◦ MethodDescriptor
 Enterprise Java Beans (EJB)
 EJB architecture
 Requirements
 Design and Implementation
 EJB session beans
 EJB entity beans
 EJB clients
 Deployment tips, tricks and traps for building
distributed systems
 Distributed objects
 Implementation and future directions of EJB
 Variables in perlperl control structures and
operators
 Functions and scope
 Remote Method Invocation (RMI): overview
 Distributed objects
 Developing applications with RMI
 Declaring & implementing remote interfaces
 Client-side stubs objects
 Server-side skeleton objects
 Registering remote objects
 RMI clients
 Servlets and RMI communication
 Pushing data from RMI Servlets
 Object Request Broker (ORB)
 ORB protocol
 A comparison of RMI and ORB protocol
 Common Object Request Broker Architecture
(CORBA)
 Java Server Pages: An introduction
 MVC and JSP
 JSP scripting elements and directives
 Working with variables scope
 Error pages
 Using Java Beans in JSP
 Working with Java Mail
 Understanding protocols in Java Mail
 Components
 Java Mail API
 Integrating into J2EE
 Understanding Java Messaging Services
 Introducing Java Transactions
THANK YOU

More Related Content

Similar to P20CSP105-AdvJavaProg.pptx

Java2 platform
Java2 platformJava2 platform
Java2 platform
Sajan Sahu
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.
suranisaunak
 
Project Presentation on Advance Java
Project Presentation on Advance JavaProject Presentation on Advance Java
Project Presentation on Advance JavaVikas Goyal
 
Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2
Mindsmapped Consulting
 
Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2
javatrainingonline
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
s4al_com
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworks
Mukesh Kumar
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
Edhole.com
 
Free Ebooks Download edhole.com
Free Ebooks Download edhole.comFree Ebooks Download edhole.com
Free Ebooks Download edhole.com
Edhole.com
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6
Lokesh Singrol
 
Online grocery store
Online grocery storeOnline grocery store
Online grocery store
Kavita Sharma
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
nomykk
 
What is hibernate?
What is hibernate?What is hibernate?
What is hibernate?
kanchanmahajan23
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
Oracle
 
What is hibernate?
What is hibernate?What is hibernate?
What is hibernate?
kanchanmahajan23
 
Suresh Resume
Suresh ResumeSuresh Resume
Suresh Resume
Suresh K N V
 
Spring (1)
Spring (1)Spring (1)
Spring (1)
Aneega
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
hchen1
 

Similar to P20CSP105-AdvJavaProg.pptx (20)

Java2 platform
Java2 platformJava2 platform
Java2 platform
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.
 
Virtual Classroom
Virtual ClassroomVirtual Classroom
Virtual Classroom
 
Project Presentation on Advance Java
Project Presentation on Advance JavaProject Presentation on Advance Java
Project Presentation on Advance Java
 
Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2
 
Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworks
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
 
Free Ebooks Download edhole.com
Free Ebooks Download edhole.comFree Ebooks Download edhole.com
Free Ebooks Download edhole.com
 
Spring survey
Spring surveySpring survey
Spring survey
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6
 
Online grocery store
Online grocery storeOnline grocery store
Online grocery store
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
What is hibernate?
What is hibernate?What is hibernate?
What is hibernate?
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
 
What is hibernate?
What is hibernate?What is hibernate?
What is hibernate?
 
Suresh Resume
Suresh ResumeSuresh Resume
Suresh Resume
 
Spring (1)
Spring (1)Spring (1)
Spring (1)
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 

Recently uploaded

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 

Recently uploaded (20)

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 

P20CSP105-AdvJavaProg.pptx

  • 1. I M.Sc(CS) Dr. T. C. Vijayaraghavan Department of Computer Science, BIHER
  • 2.  Servlet Overview What is meant by a Servlet? Background on the web Servlet Life Cycle
  • 3.  Tomcat web server  A Simple Servlet  Using Eclipse or Apache Net Beans IDE
  • 4.  Servlet API ◦ The javax.servlet Package Interface Description Servlet Declares life cycle methods for a servlet ServletConfig Allows servlets to get initialization parameters. ServletContext Enables servlets to log events and access information about their environment. ServletRequest Used to read data from a client request. ServletResponse Used to write data to a client response.
  • 5.  Servlet API (continued…) Class Description GenericServlet Implements the Servlet and ServletConfig interfaces. ServletInputStream Encapsulates an input stream for reading requests from a client. ServletOutputStream Encapsulates an output stream for writing responses to a client. ServletException Indicates a servlet error occurred. UnavailableException Indicates a servlet is unavailable.
  • 6.  Servlet API ◦ The javax.servlet.http Package Interface Description HttpServletRequest Enables servlets to read data from an HTTP request. HttpServletResponse Enables servlets to write data to an HTTP response. HttpSession Allows session data to be read and written.
  • 7.  Servlet API (continued…) Class Description Cookie Allows state information to be stored on a client machine. HttpServlet Provides methods to handle HTTP requests and responses. Cookie: The Cookie class encapsulates a cookie. A cookie is stored on a client and contains state information. Cookies are valuable for tracking user activities.
  • 8.  A cookie can save the user’s name, address, and other information.  The user does not need to enter this data each time he or she visits the store.  A servlet can write a cookie to a user’s machine via the addCookie( ) method of the  HttpServletResponse interface.  The data for that cookie is then included in the header of the HTTP response that is sent to the browser.
  • 9. Session Tracking using Servlets Security issues
  • 10.  Using JDBC in Servlets ◦ RDBMS ◦ Java’s JDBC API ◦ Uses Structured Query Language (SQL) ◦ Servlets are in the middle tier in the 3-tier architecture for accessing databases.
  • 11. Using JDBC in Servlets
  • 12.  HTML to Servlet communication  Java Object serialization: allows you to take any object that implements the Serializable interface and turn it into a sequence of bytes that can later be fully restored to regenerate the original object. This is true even across a network which means that the serialization mechanism automatically compensates for differnces in operating systems.
  • 13.  Applets are small applications that are accessed on an Internet server, transported over the Internet automatically installed, and run as part of a web document. After an applet arrives on the client, it has limited access to resources so that it can produce a graphical user interface and run various computations without introducing the risk of viruses or breaching data integrity.  Applet to Servlet communication.
  • 14.  The software component developer  The software component assembly model
  • 15.  What is a Java Bean? ◦ A Java Bean is a software component that has been designed to be reusable in a variety of different environments. There is no restriction on the capability of a Bean. It may perform a simple function, such as obtaining an inventory value, or a complex function, such as forecasting the performance of a stock portfolio. A Bean may be visible to an end user. One example of this is a button on a graphical user interface. A Bean may also be invisible to a user. Software to decode a stream of multimedia information in real time is an example of this type of building block. Finally, a Bean may be designed to work autonomously on a user’s workstation or to work in cooperation with a set of other distributed components.
  • 16.  Examples of Java Bean: Software to generate a pie chart from a set of data points is an example of a Bean that can execute locally. However, a Bean that provides real-time price information from a stock or commodities exchange would need to work in cooperation with other distributed software to obtain its data.
  • 17.  Advantages of Java Beans ◦ A Bean obtains all the benefits of Java’s “write-once, run- anywhere” paradigm. ◦ The properties, events, and methods of a Bean that are exposed to another application can be controlled. ◦ Auxiliary software can be provided to help configure a Bean. ◦ The state of a Bean can be saved in persistent storage and restored at a later time. ◦ A Bean may register to receive events from other objects and can generate events that are sent to other objects.
  • 18.  Developing Java Beans  Notable Beans  Using Infobus  Glasgow developments  Application builder tool
  • 19.  Java Archive (JAR) file format: is a way to collect a group of files into a single compressed file, just like Zip. JAR files are cross-platform. They are especially helpful when you deal with the Internet. A JAR file consists of a single file containing a collection of zipped files along with a “manifest” file that describes them.
  • 20.  Introspection ◦ This is the process of analyzing a Bean to determine its capabilities. This is an essential feature of the Java Beans API because it allows another application, such as a design tool, to obtain information about a component. Without introspection, the Java Beans technology could not operate.  Bound properties ◦ A Bean that has a bound property generates an event when the property is changed.  Constrained properties ◦ A Bean that has a constrained property generates an event when an attempt is made to change its value.
  • 21.  Persistence ◦ Persistence is the ability to save the current state of a Bean, including the values of a Bean’s properties and instance variables, to nonvolatile storage and to retrieve them at a later time. The object serialization capabilities provided by the Java class libraries are used to provide persistence for Beans.
  • 22.  Customizers ◦ A Bean developer can provide a customizer that helps another developer configure the Bean. A customizer can provide a step-by-step guide through the process that must be followed to use the component in a specific context. Online documentation can also be provided. A Bean developer has great flexibility to develop a customizer that can differentiate his or her product in the marketplace.
  • 23.  Java Beans API: some important classes ◦ Introspector ◦ PropertyDescriptor ◦ EventSetDescriptor ◦ MethodDescriptor
  • 24.  Enterprise Java Beans (EJB)  EJB architecture  Requirements  Design and Implementation  EJB session beans  EJB entity beans
  • 25.  EJB clients  Deployment tips, tricks and traps for building distributed systems  Distributed objects  Implementation and future directions of EJB  Variables in perlperl control structures and operators  Functions and scope
  • 26.  Remote Method Invocation (RMI): overview  Distributed objects  Developing applications with RMI  Declaring & implementing remote interfaces  Client-side stubs objects  Server-side skeleton objects
  • 27.  Registering remote objects  RMI clients  Servlets and RMI communication  Pushing data from RMI Servlets  Object Request Broker (ORB)  ORB protocol
  • 28.  A comparison of RMI and ORB protocol  Common Object Request Broker Architecture (CORBA)
  • 29.  Java Server Pages: An introduction  MVC and JSP  JSP scripting elements and directives  Working with variables scope  Error pages  Using Java Beans in JSP  Working with Java Mail
  • 30.  Understanding protocols in Java Mail  Components  Java Mail API  Integrating into J2EE  Understanding Java Messaging Services  Introducing Java Transactions