Servlet Interview Questions (Java EE) – 60
- What is Servlet?
- What is Servlet Lifecycle?
- What is Web Server?
- What is Servlet Container?
- How Servlet object is created by Servlet Container?
- How many methods are there in Servlet interface
- What is the difference between GenericServlet and HttpServlet?
- How a servlet can be used for different protocols?
- What is Web Engine?
- What is Http Server?
- What is ServletContext object and where to use it?
- What is ServletConfig object?
- What is HttpSession?
- How to manage Session and describe different techniques to manage it?
- What SingleThreadModel?
- What is the difference between RequestDispatcher.include() and RequestDispatcher.forward() method?
- What is the difference between RequestDispatcher.include() and HttpServletResponse.sendRedirect() method?
- What is Cookie?
- What are the types of Cookies?
- What is Servlet Chaining?
- How to share Java Objects from one Servlet to another Servlet?
- How to share Java Objects using request scope?
- How to share Java Objects using session scope?
- How to share Java Objects using application scope?
- What is scoped variable in Servlet?
- What is the default session timeout for Java web application?
- What is cache management and how to set it? (Browser Cache)
- What are the different request methods?
- What is the difference between GET and POST methods?
- What is the difference between HEAD and POST methods?
- How can we use Servlet for RESTFul web services implementation?
- How can we use Servlet for JSON?
- What is MIME Type?
- How a Servlet can generate different kind of response?
- How to set response type in Servlet?
- How a Servlet can generate image response?
- What is the different between doGet() and doPost() method?
- What is the use of ServletOutputStream object?
- What is the difference between init-param and context-param?
- How to configure declarative exception in Servlet?
- Why we need to use synchronized-code when access scoped variables in Servlet web application?
- What is the role of ServletContextListener in web application?
- How many ways are there to define url patterns?
- What is deployment descriptor?
- Can we develop a web application without deployment descriptor file and how?
- How to write a Servlet using Annotation?
- What are the thread guideline for Servlet application?
- How to delete a Cookie?
- How can we include a jsp page in Servlet?
- How to pass parameters to Servlet?
- What is the difference between request-parameters and request-attributes?
- How to connect database in Servlet application?
- What is url-rewriting?
- How to set session timeout from code?
- How to set cookie age in Servlet?
- What are the methods we usually override in Servlet class?
- Who is responsible for managing Servlet object?
- What is HttpServlet?
- How to develop thread-safe Servlet?
- What is RequestDispatcher object in Servlet?