|
INTERVIEW QUESTIONS
J2EE
JAVA
DETAILS
Question: Can we have 3 methods in a single servlet i.e service(), doPost() and doGet() method. If yes, then what method will be called. Tell me the servlet cycle in such cases
Answer: First servlet looks for the service() method.If in the case service() method is not present in that appilication, then looks for the doPost() method.If doPost() method is also not present in your appilication ,then servlet looks for the doGet() method.when u used tha doGet() method,This method will shows to "Querystring" also.It doesnot provide the security.
|
|
|
Category |
Java Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 8001 users |
Added on |
7/14/2011 |
Views |
67965 |
Rate it! |
|
|
Question:
Can we have 3 methods in a single servlet i.e service(), doPost() and doGet() method. If yes, then what method will be called. Tell me the servlet cycle in such cases
Answer:
First servlet looks for the service() method.If in the case service() method is not present in that appilication, then looks for the doPost() method.If doPost() method is also not present in your appilication ,then servlet looks for the doGet() method.when u used tha doGet() method,This method will shows to "Querystring" also.It doesnot provide the security. 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 |
|
What is the difference between servlets and jsp
|
View Answer
|
|
What is the diffrence between JRE and JVM?
|
View Answer
|
|
what is servelet?
|
View Answer
|
|
Why java.lang Package is the Default package?
|
View Answer
|
|
What is the disadvantage of paint method in Applet
|
View Answer
|
|
Can we set the time (by user) explicitly for garbage collection.?
|
View Answer
|
|
How does >> operater works ?
|
View Answer
|
|
Difference between Applet and JApplet
|
View Answer
|
|
Difference between Enumeration and Iterator
|
View Answer
|
|
How do you release an object which is locked in a synchronized block
|
View Answer
|
|
Difference between HashMap and TreeMap
|
View Answer
|
|
How can a Variable in a class other than String type be made Immutable.
|
View Answer
|
|
Why we can't put semicolon at the end of a class in java??
|
View Answer
|
|
Why arraylist(and other classes) cantnot be synchronized
|
View Answer
|
|
Why main method should be declared as public and why in some versions it is mandatory and in some versions it is not mandatory??
|
View Answer
|
|
Plz give me detail difference between Tomcat & Weblogic server
|
View Answer
|
|
How you can add the 10 days in the current date in jsp?
|
View Answer
|
|
What is socket? and server socket?
|
View Answer
|
|
Why Concept Of Pointer is not there in java
|
View Answer
|
|
When does JIT plays its role. Does JIT come along with jdk? If so then what is role of interpreter?
|
View Answer
|