0% found this document useful (0 votes)
40 views

Three-Tier Application: Servlet Life Cycle

The document describes a three-tier application architecture consisting of a presentation layer, application layer, and database layer. The presentation layer handles the user interface. The application layer coordinates tasks, processes commands, and transfers data between the presentation and database layers. The database layer stores and retrieves information from the database and passes it to the application layer.

Uploaded by

ShivaInfos
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Three-Tier Application: Servlet Life Cycle

The document describes a three-tier application architecture consisting of a presentation layer, application layer, and database layer. The presentation layer handles the user interface. The application layer coordinates tasks, processes commands, and transfers data between the presentation and database layers. The database layer stores and retrieves information from the database and passes it to the application layer.

Uploaded by

ShivaInfos
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Three-Tier Application

1. GUI Presentation
The top-most level of the application is the User Interface. The main function of this
interface is to translate tasks and results to something the user can understand.
2. Application Login
This layer coordinates the application, process commands,makes logical decisions
and evaluations, performs calculations. It also moves and process data between
Presentation layer and Database layer.
3. DataBase Retrieval
Here information is stored and retrieved from the Database. This information is
process back to Application layer and then it is processed to Presentation Layer.



What is Servlet
Servlet is a specification released by Sunmicrosystem to develop web applications.
Servlet is a Server side running java program, that accepts Http protocol request and gives
Http response back to the client running on web or application server.
Servlets Api comes in mainly two packages.
Javax.servlet and javax.servlet.http.

Servlet Life Cycle
When the servlet is first created, its init method is invoked,
1. init()
2. service()
3. destroy()





Handling Client Request



1. Request Headers
2. Status Codes
3. Response Headers


Handling Cookies


Session Tracking


Filters

Listeners


Advantages & Disadvantage
Advantages Disadvantages
Efficient


Powerful


Secure







Disadvantages:
Developers MUST know JAVA
Web Administrator will need to learn how to install and maintain Java Servlets
Tedious uses of out.println() statements
Can be remedied by using Java Server Page (JSP)
















Javax.servlet.Servlet
void init(ServletConfig config)
void service(ServletRequest req,ServletResponse res)
ServletConfig getServletConfig()
String getServletInfo()
void destroy()

Javax.servlet.GenericServlet implements Servlet
void init(ServletConfig config)
ServletConfig getServletConfig()
String getServletInfo()
void destroy()

Javax.servlet.http.HttpServlet extends GenericServlet
void init(ServletConfig config)
void service(ServletRequest req,ServletResponse res)
ServletConfig getServletConfig()
String getServletInfo()
void destroy()

You might also like