|
INTERVIEW QUESTIONS
J2EE
SERVLET
DETAILS
Question: What is difference between cgi and servlet in interview point
Answer: 1.CGI creates a new process for each request,Whereas Servlet creates a thread for each request and services the request in that thread.
2.For each process created by CGI,the process is assinged seperate address space.SO there is memory overload on the server.Whereas for every thread created by the servlet,no seperate address space is created,all threads operate in the same parent process address space.so there is no memory overlaod.
3.CGI is not based on pooling,Whereas servlet are container managed pooled objects
|
|
|
Category |
Servlet Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 9121 users |
Added on |
7/17/2011 |
Views |
73287 |
Rate it! |
|
|
Question:
What is difference between cgi and servlet in interview point
Answer:
1.CGI creates a new process for each request,Whereas Servlet creates a thread for each request and services the request in that thread.
2.For each process created by CGI,the process is assinged seperate address space.SO there is memory overload on the server.Whereas for every thread created by the servlet,no seperate address space is created,all threads operate in the same parent process address space.so there is no memory overlaod.
3.CGI is not based on pooling,Whereas servlet are container managed pooled objects Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Can we override the service method? if we can do that then why do we override only doGET() and doPost() methods if the servlet is of protocol specific?
|
View Answer
|
|
What will happen when we call the destroy method in the init method? will the servlet exist?
|
View Answer
|
|
Suppose number of servlets/jsps from various web applications want to access shared data, what is the mechanism to achieve the same?
|
View Answer
|
|
How to integare struts and hibernate
|
View Answer
|
|
What is meant by preintialization?
|
View Answer
|
|
Suppose there are 15 links on the homepage of a site and each link creates a new request, how your servlet controller would handle it? (Assuming you are using MVC-2)
|
View Answer
|
|
How to Access Session Variables in Servlets & JSp
|
View Answer
|
|
When we have the servlets/struts what is the perpose of EJB
|
View Answer
|
|
Which method is more advantageous doGET() or doPOST()? in which situation does we use doGET() then?
|
View Answer
|
|
How you can activate or call one another servlet method?
|
View Answer
|
|
Can we write destroy() method in the init() method of a Servelt.
if we can, what will happen?
if we cant , why we cant?
|
View Answer
|
|
Why init is used and not constructor for servlets initialization?
|
View Answer
|
|
What is the difference between the getRequestDispatcher(String path) method of javax.servlet.ServletRequest interface and javax.servlet.ServletContext interface?
|
View Answer
|
|
What is the difference between GenericServlet and HttpServlet?
|
View Answer
|
|
What are the differences between GET and POST service methods?
|
View Answer
|
|
What is the difference between ServletContext and ServletConfig?
|
View Answer
|
|
Can I invoke a JSP error page from a servlet?
|
View Answer
|
|
Can I just abort processing a JSP?
|
View Answer
|
|
What is a better approach for enabling thread-safe servlets and JSPs? SingleThreadModel Interface or Synchronization?
|
View Answer
|
|
If you want a servlet to take the same action for both GET and POST request, what should you do?
|
View Answer
|