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.
By Ramakrishna on Jul 7, 2008 in Servlet Interview Questions | 0 Comments
Q) What is the servlet?
A) Servlets are modules that extend request/response-oriented servers, such as Java-enabled web servers. For example, a servlet might be responsible for taking data in an HTML order-entry form and applying the business logic used to update a company’s order database.
Servlets are to servers what applets are to browsers. Unlike applets, however, [...]