Introduction to Servlets

While surfing any website on the internet, for any page in it there are two things that happens, request and response between the client and server. Client sends a request to retrieve any page and response comes from the server.

There are basically t…


This content originally appeared on DEV Community and was authored by Saumya Agnihotri

While surfing any website on the internet, for any page in it there are two things that happens, request and response between the client and server. Client sends a request to retrieve any page and response comes from the server.

There are basically two types of pages - static and dynamic. Dynamic pages are those pages which are created during run time.

Web containers

So now to understand where servlets fits in this picture, we need to understand something called web containers which are nothing but helper applications which are used to generate these dynamic pages. These helper functions contains servlets for the same purpose. Apache Tomcat is one of the examples for web containers.

Servlets

Now what exactly this servlet does and what it is exactly? It's nothing but a java file which can take the request from the client on the internet and it can process that request and it can provide you a response in the form of an HTML page. It's a normal class that extends HttpServlets

Deployment Descriptor

Now how does this web container will know which servlet is suitable for handling any incoming request. Well, for that we have web.xml files which are also know as deployment descriptor. Here you mention for which request which servlet should be called.


This content originally appeared on DEV Community and was authored by Saumya Agnihotri


Print Share Comment Cite Upload Translate Updates
APA

Saumya Agnihotri | Sciencx (2021-09-11T19:02:33+00:00) Introduction to Servlets. Retrieved from https://www.scien.cx/2021/09/11/introduction-to-servlets/

MLA
" » Introduction to Servlets." Saumya Agnihotri | Sciencx - Saturday September 11, 2021, https://www.scien.cx/2021/09/11/introduction-to-servlets/
HARVARD
Saumya Agnihotri | Sciencx Saturday September 11, 2021 » Introduction to Servlets., viewed ,<https://www.scien.cx/2021/09/11/introduction-to-servlets/>
VANCOUVER
Saumya Agnihotri | Sciencx - » Introduction to Servlets. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/09/11/introduction-to-servlets/
CHICAGO
" » Introduction to Servlets." Saumya Agnihotri | Sciencx - Accessed . https://www.scien.cx/2021/09/11/introduction-to-servlets/
IEEE
" » Introduction to Servlets." Saumya Agnihotri | Sciencx [Online]. Available: https://www.scien.cx/2021/09/11/introduction-to-servlets/. [Accessed: ]
rf:citation
» Introduction to Servlets | Saumya Agnihotri | Sciencx | https://www.scien.cx/2021/09/11/introduction-to-servlets/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.