Friends Today I Would Like TO Write The Topic is Servlets In Java.First We are Know The Importance Of Servlets and Why it can be Used in Java,What are the Topic we have Related To Servlets and how important in Servlets is the most important topic in Java .This article is very helpful to understand Servlets topic.
Servlets in Java
Introduction about Servlets
A Servlet is a Java Program that is execute at the serverside.Servlet related classes are contained in two packages.
1.Javax.servlet.*;
2.Javax.servlet.http.*;
- A simple java Program gets the functionality of a servlet by eithe extending generic servlet or http servlet.
- user interface is used to gather a request from a person and forward these request to a component for processing.the component that processes the request is belt using servlet or jsp previously. we used CGI technology used.
- Common Gateway interface is slow in response.
- A client can send a request to server in two ways.
1.get()
2.post()
- If you use get()method from contains will appear in the url.It is not very secure.
- post()method is secure way to send the data.
Servlets Lifecycle
Life Cycle |
Servlet life cycle contains 3 stages
1.Init()
2.Service()
3.Destroy()
- Init() method is executed when the servlet is first time loaded into memory.
- Service() method is execute each time when a client makes some request.Service()method can be replaced diGet() or doPost() method.
- A deployment descripter file(web.xml) will help us in managing servlets.we can also givewelcome file information inside that file.
- A servlet container is the where all servlets run.
Found this article useful then share it with others because sharing is caring. Also comment if you have any query then feel free to ask, I will come with the answer.
0 comments:
Post a Comment