|
INTERVIEW QUESTIONS
J2EE
SERVLET
DETAILS
Question: Can we write destroy() method in the init() method of a Servelt.
if we can, what will happen?
if we cant , why we cant?
Answer: we cannot write destroy() method in the init() method..because init(),service(), and destroy methods are life cycle methods the servlet management executable program in the servlet container(which is a part of webserver) is written like that ......
so we can write the servlet by overriding these three methods individually
|
|
|
Category |
Servlet Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 9655 users |
Added on |
7/17/2011 |
Views |
69762 |
Rate it! |
|
|
Question:
Can we write destroy() method in the init() method of a Servelt.
if we can, what will happen?
if we cant , why we cant?
Answer:
we cannot write destroy() method in the init() method..because init(),service(), and destroy methods are life cycle methods the servlet management executable program in the servlet container(which is a part of webserver) is written like that ......
so we can write the servlet by overriding these three methods individually 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 |
|
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
|
|
What is the servlet life cycle?
|
View Answer
|
|
Which code line must be set before any of the lines that use the PrintWriter?
|
View Answer
|
|
How HTTP Servlet handles client requests?
|
View Answer
|
|
What is the Servlet Interface?
|
View Answer
|
|
When a servlet accepts a call from a client, it receives two objects. What are they?
|
View Answer
|
|
What information that the ServletRequest interface allows the servlet access to?
|
View Answer
|
|
What information that the ServletResponse interface gives the servlet methods for replying to the client?
|
View Answer
|
|
What is the servlet?
|
View Answer
|
|
What are the uses of Servlets?
|
View Answer
|
|
What are the advantages using servlets than using CGI?
|
View Answer
|
|
What is the difference between servlets and applets?
|
View Answer
|