Chapter 28 Flashcards
Can we create and destroy servlet
Yes
What is servlet life cycle/stages
1- Initialize
2- Service
3- Destroy
What is method to initialize servlet
init()
It is called only once
Is there constructor in servlet
No
What method is used for service for servlet
service()
What is service stage of servlet
The service() stage is the engine of the servlet, which actually processes the client’s request. On every request from the client, the server spawns a new thread and calls the service() method. This makes it more efficient as compared to the technologies that use single thread to respond to requests.
What is method for destroy stage of servlet
destroy()
What is destroy stage
The web server may decide to remove a previously loaded servlet instance. It is called servlet destroy.
What are 2 types of data submit to web server
- Form data
2. HTTP Request Header Data
What are 3 methods of HttpServletRequest to extract data from html form
getParameter
getParameterValues
getParameterNames
What is the port number of tomcat server bundled with netbeans by default
8084