Servlet Architecture




Servlet: It is an interface that contains important methods like:init( getServletConfiguration() ), Service(), Destroy() that are used by servlet lifecycle.

Serializable: It contains built in methods like: write(), read() and read object with no data.

Servlet Config: It provides a secure server side environment.

Generic Servlet: It is an abstract class. Since servlet contain other methods as well but we don't use all methods in our program, so we make an abstract class. It contain init() and destroy() method as they are used only once.

httpServlet: It extends GenericServlet class. Here we define the Service method, which is used more than once.

User Defined Class: It extends the httpServlet class and contain th business logic as defined by user.

Steps involed in running a web app:
1. user request to run web app by issuing the url.
2. Html/Jsp page is loaded into the client's browser.
3. Client fill the required sections,and press enter.
4. The client side program sends the parameters to the server side program.
5. The server side program read the requeat and send the response back to th client depending on the requested source.
6. The client side programs receive the response and display tha output.

For transferring the information, server uses HTTP ie Hypertext Transfer Protocol.

Flow of a web application: