Sunday, March 27, 2011

Important Servlet Interview Questions

1) Servlet Life Cycle?
2) How can you extract configuration information from web.xml inside your servlet?
3) How can you use ServletContext object to share information among servlets?
4) Difference between using response.sendRedirect() and requestDispatcher object for forwarding from one servlet to another? Which one should be used and when?
5) What are the different ways to do session management in servlets?
6) How do u implement urlrewriting,hiddenfields,cookies and HttpSession objects?
7) How to send session identifier to client machine if cookie is disabled? Hints response.encodeURL() method.
8) What are the use of servlet filters.
9) Interfaces implemented to create a filter?
10) What is the difference between doFilter() method of Filter interface and doFilter() method of FilterChain interface?
11) How to use Servlet Listener to create a website counter, and how to use it to show how many users are online?


Click for Private Tuition by a Professional