Java servlet interview questions list.

  1. What is the servlet? 
  2. What are the JSP atrributes? 
  3. What is the need of super.init(config) in servlets? 
  4. How to know whether we have to use jsp or servlet in our project? 
  5. Can we call destroy() method on servlets from service method? 
  6. What is the Servlet Interface? 
  7. What is the difference between GenericServlet and HttpServlet? 
  8. How we can check in particular page the session will be alive or not? 
  9. What is the importance of deployment descriptor in servlet? 
  10. When we increase the buffer size in our project using page directive attribute ‘buffer’ what changes we observe? 
  11. What is the difference between ServetConfig and ServletContext..? 
  12. When a servlet accepts a call from a client, it receives two objects. What are they? 
  13. What are the differences between GET and POST service methods? 
  14. In which conditions we have to use the ServletContext? 
  15. What methods will be called in which order?((i.e)service(),doget(),dopost()) 
  16. Servlet is Java class. Then why there is no constructor in Servlet? Can we write the constructor in Servlet 
  17. What is the use of ServletConfig and ServletContext..? 
  18. What information that the ServletRequest interface allows the servlet access to? 
  19. What is the difference between ServletContext and ServletConfig? 
  20. When do you have action=get? 
  21. What is a Singleton class. How do you write it? 
  22. What is difference between sendRedirect() and forward()..? Which one is faster then other and which works on server? 
  23. What information that the ServletResponse interface gives the servlet methods for replying to the client? 
  24. Can I invoke a JSP error page from a servlet? 
  25. Can a init(ServletConfig config) method be overrided in servlets? 
  26. How many ServletConfig and servlet context objects are present in one application? 
  27. Do we have a constructor in servlet? can we explictly provide a constructor in servlet programme as in java program? 
  28. What are the uses of Servlets? 
  29. Can I just abort processing a JSP? 
  30. Is servlet is used to create a dynamic webpage or Static webpage or both? 
  31. If you want a servlet to take the same action for both GET and POST request, what should you do? 
  32. What is the difference between JSP and SERVLETS? 
  33. What are the advantages using servlets than using CGI? 
  34. What is a better approach for enabling thread-safe servlets and JSPs? SingleThreadModel Interface or synchronization? 
  35. We have two applications in that we have two servlets each.How they(servlets) communicate with each other? 
  36. How the server will know (i.e) when it can invoke init, service,destroy methods of servlet life cycle? 
  37. How to communicate between two servlets? 
  38. What is the difference between servlets and applets? 
  39. How will u pass the argument from one servlet to another servlet? 
  40. What method used to add a jsp to the servlet? 
  41. How HTTP Servlet handles client requests? 
  42. How to get one Servlet’s Context Information in another Servlet? 
  43. Difference between single thread and multi thread model servlet 
  44. What is the super class of All servlets? 
  45. How are Servlet Applet communication achieved? 
  46. What is servlet context and what it takes actually as parameters? 
  47. What is the servlet life cycle? 
  48. Types of Servlets? 
  49. Why is that we deploy servlets in a webserver.What exactly is a webserver? 
  50. Which code line must be set before any of the lines that use the PrintWriter?
  51. What is the difference between CGI and Servlet? 
  52. What is meant by a servlet? 
  53. What are the types of servlets? What is the difference between 2 types of Servlets? 
  54. What is the type of method for sending request from HTTP server ? 
  55. What are the exceptions thrown by Servlets? Why? 
  56. What is the life cycle of a servlet? 
  57. What is meant by cookies? Why is Cookie used? 
  58. What is HTTP Session? 
  59. What is the difference between GET and POST methods? 
  60. How can you run a Servlet Program? 
  61. What is the middleware? What is the functionality of Webserver? 
  62. What webserver is used for running the Servlets? 
  63. How do you invoke a Servelt? What is the difference in between doPost and doGet methods? 
  64. What is the difference in between the HTTPServlet and Generic Servlet? Explain their methods? Tell me their parameter names also? 
  65. What are session variable in Servlets? 
  66. What is meant by Session? Tell me something about HTTPSession Class? 
  67. What is Session Tracking? 
  68. Difference between doGet and doPost? 
  69. What are the methods in HttpServlet? 
  70. What are the types of SessionTracking? Why do you use Session Tracking in HttpServlet?

Search Topics

Popular Posts