|
INTERVIEW QUESTIONS
J2EE
SERVLET
DETAILS
Question: I can do every thing using jsp itself,then what is the need of using servlet? in which situation ,we must use servlet with jsp?
Answer: We cann't implements interface in Jsp but it is in the servlet. Yes, it is true, we can every thing in JSP as in the servlet. But, Jsp is always used for design layout or view whereas the servlet is used to code the business logic.
Why is it in servlet? Because Servlet is the .java file and we simply write the java code for controlling the business. The servlet is controlled by web container and it creates it multiple instances automatically.
|
|
|
Category |
Servlet Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 6612 users |
Added on |
7/17/2011 |
Views |
71568 |
Rate it! |
|
|
Question:
I can do every thing using jsp itself,then what is the need of using servlet? in which situation ,we must use servlet with jsp?
Answer:
We cann't implements interface in Jsp but it is in the servlet. Yes, it is true, we can every thing in JSP as in the servlet. But, Jsp is always used for design layout or view whereas the servlet is used to code the business logic.
Why is it in servlet? Because Servlet is the .java file and we simply write the java code for controlling the business. The servlet is controlled by web container and it creates it multiple instances automatically. 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 |
|
How to count how many times aprticular link has been clicked using jsp and javascript
|
View Answer
|
|
What is session ?how to manage the session?
|
View Answer
|
|
Can we write bussiness methods in servlets? if yes, then how can u access that from out side of the servlets?
|
View Answer
|
|
What is the difference betweem getRequestDispatcher() available as part of ServletContext and ServletRequest
|
View Answer
|
|
Explain StringBuffers and StringTokenizers?
|
View Answer
|
|
What is differents between forword(),include() and sendRedirect()? In which circumtances all are used? Give Proper Examles
|
View Answer
|
|
What are the types of refrences available in java. How they work
|
View Answer
|
|
What is difference between cgi and servlet in interview point
|
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
|