Servlet

Java Servlet Interview Questions and Answers

This article provide a list of java servlet interview questions and answers to help you pass the java developer or tester interview. Because servlet is the key component of java web application, it is more popular these days. There are a lot of framework such as Struts and Spring are all developed based on servlet. …

Java Servlet Interview Questions and Answers Read More »

Servlet RequestDispatcher And SendRedirect

There are two methods in servlet to dispatch user request to other web resources such as jsp, html or another servlet in the same or different web applications. They are RequestDispatcher interface and HttpServletResponse’s sendRedirect() method. RequestDispatcher is used to dispatch request to the resource run in same web applications, and sendRedirect() can be used to redirect client …

Servlet RequestDispatcher And SendRedirect Read More »

ServletConfig Vs ServletContext

ServletConfig is used to read servlet configuration data in web.xml. Web container will create one ServletConfig instance for each servlet. The advantage of use this object is that you can make your servlet variable’s value parameterized. You can save the variable value in web.xml as servlet init parameters and get that value from web.xml in your …

ServletConfig Vs ServletContext Read More »

Hello World Example Use Servlet

Servlet is the most important web component in Java EE Web application. It is also the foundation of many Java EE framework such as Spring, JSF, Struts etc. In this article we will show you how to write a basic hello world servlet java program use eclipse step by step.

Servlet Overview

Website consists of static resources and dynamic resources. Static resources include html page, javascript, css, images etc. And dynamic resources includes CGI, Servlet, JSP etc. In this article we will give you a general explanation about Web Applicaion, J2EE Servlet and CGI. We will also compare them to point out the advantage and disadvantage of using …

Servlet Overview Read More »

Servlet Life Cycle

Servlet is managed by servlet container, the container manages the entire lifecycle of it. From below picture, you can see how the container manage it’s lifetime and how the container handle multiple http request send to it.