By Ramakrishna on Apr 7, 2009 in Servlet Interview Questions | 0 Comments
OVERVIEW OF SERVLETS
Servlets provide a Java based solution used to address the problems currently associated with doing server side programming including inextensible scripting solution, platform specific API’s, and incomplete interfaces.
Servlets are objects that confirm to a specific interface that can be plugged into a Java based server. Servlets are to the server side what applets [...]
By Ramakrishna on Oct 5, 2008 in Servlet Interview Questions | 0 Comments
Q) How to ensure the thread safety of the servlet?
Rep)
1) It is better to avoid instance variables & static variables in a servlet class
2) If the instance variable reference to a threadsage object then there will be no problem
3) If all Instance variables refers to an object that is not thread safe then we [...]
By Ramakrishna on Oct 5, 2008 in Servlet Interview Questions | 0 Comments
Rep) As the Web Container uses newInstance() method for creating the servlet object,If requiered we can provide a zero arguent constructor
By Ramakrishna on Oct 5, 2008 in Servlet Interview Questions | 0 Comments
Rep) Web Container reads the name of the servlet class from web.xml and uses Class.forName() method to load the servlet class and it calls the newInstance() method to create the servlet Object.