Sie sind auf Seite 1von 6

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()





















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.

Das könnte Ihnen auch gefallen