-
-
-
-
-
-
-
-
-
Describe Servlet Class Hierarchy.
Class java.lang.Object
-
Servlets Questions
1)What is web.xml?2)what is the filter?3)How to we create a new JSTL class?4)When we are developing the project which collections mostly used?5)Difference between reqeust.getAttribute,and request.getParameter?
-
When a servlet accepts a call from a client, it receives two objects. What are they?
ServeltRequest: which encapsulates the communication from the client to the server.ServletResponse: which encapsulates the communication from the servlet back to the client.ServletRequest and ServletResponse are interfaces defined by the javax.servlet package.
-
What are the uses of Servlets?
A servlet can handle multiple requests concurrently, and can synchronize requests. This allows servlets to support systems such as on-line conferencing. Servlets can forward requests to other servers and servlets. Thus servlets can be used to balance load among several servers that mirror the same content, and to partition a single logical service over several servers, according to task.
-
What are the advantages using servlets than using CGI?
Servlets provide a way to generate dynamic documents that is both easier to write and faster to run. It is efficient, convenient, powerful, portable, secure and inexpensive. Servlets also address the problem of doing server-side programming with platform-specific APIs. They are developed with Java Servlet API, a standard Java extension.
-
Difference between single thread and multi thread model servlet
Answered by Scott on 2005-05-12 10:39:32: A servlet that implements SingleThreadModel means that for every request, a single servlet instance is created. This is not a very scalable solution as most web servers handle multitudes of requests. A multi-threaded servlet means that one servlet is capable of handling many requests which is the way most servlets should be implemented. A single...
-
Can we call destroy() method on servlets from service method?
">Can we call destroy() method on servlets from service method?
destroy() is a servlet life-cycle method called by servlet container to kill the instance of the servlet. The answer to your question is "Yes". You can call destroy() from within the service(). It will do whatever logic you have in destroy() (cleanup, remove attributes, etc.) but it won't "unload" the servlet instance itself. That can only be done by the container
-
-
How to communicate between two servlets?
ANS: Two ways:1. Forward or redirect from one Servlet to another.2. Load the Servlet from ServletContext and access methods.
-
-
-
Servlets Interview Questions
Ans