Home » servlet » Page 2

Tag Archives: servlet

Java Servlet Database Connectivity Example

Servlets are modules of the Java code that run in a server application to answer the client requests. In this tutorial, we will explain and show you how to connect the servlet to the database. 1. Introduction Servlet is a Java program which exists and executes in the J2EE servers and is used to receive the HTTP protocol request, process ...

Read More »

Java Servlet Cookie Methods Example

Servlets are modules of the Java code that run in a server application to answer the client requests. In this tutorial, we will show you how to store the user information in the cookie object and access it in the Servlet. 1. Introduction Servlet is a Java program which exists and executes in the J2EE servers and is used to ...

Read More »

Java Servlet HTTP Response Headers Example

Servlets are modules of the Java code that run in a server application to answer the client requests. In this tutorial, we will explain and show you how to use the HTTP response headers in the Servlet page. 1. Introduction Servlet is a Java program which exists and executes in the J2EE servers and is used to receive the HTTP ...

Read More »

Java Servlet HTTP Request Headers Example

Servlets are modules of the Java code that run in a server application to answer the client requests. In this tutorial, we will explain and show you how to display the HTTP header information of a request in the Servlet page. 1. Introduction Servlet is a Java program which exists and executes in the J2EE servers and is used to ...

Read More »

Java Servlet Bean Example

Servlets are modules of the Java code that run in a server application to answer the client requests. In this tutorial, we will explain how to handle the JavaBean in a Servlet. 1. Introduction Servlet is a Java program which exists and executes in the J2EE servers and is used to receive the HTTP protocol request, process it and send ...

Read More »

Java Servlet Sync Context Example

Async Servlet was introduced in Servlet 3.0. It is a great way to deal with the thread starvation problem with the long-running threads. In this tutorial, we will understand what Async Servlet is.                     1. Introduction Let’s say we have a Servlet that takes a lot of time to process, something ...

Read More »

Java Servlet SendRedirect Example

Communication between the Servlets is an important task to the programmer. sendRedirect() can be used to communicate between two servlets present in the different servers. The output will be the same as the Request Dispatcher Forward example but the URL of the page will be changed to the redirected page. In this tutorial, we will see how the sendRedirect() method ...

Read More »

Java Servlet Annotations Example

Communication between the Servlets is an important task to the programmer. In this tutorial, we will see how the Servlet annotations can replace the equivalent XML configuration in the web deployment descriptor file (web.xml). 1. Introduction The Servlet API 3.0 introduces a new package called javax.servlet.annotation which provides the annotation types which can be used for annotating a Servlet class. ...

Read More »

Java Servlet Life Cycle Example

Servlets are modules of the Java code that run on a server application to answer the client requests. They are not tied to a specific client-server protocol but are most commonly used with HTTP and the word “Servlet” is often used in the meaning of “HTTP Servlet“. In this tutorial, we will explain the Servlet Lifecycle. 1. Introduction Servlet is ...

Read More »

Java Servlet Filter Example

Servlets are modules of the Java code that run in a server application to answer the client requests. In this tutorial, we will explain how to implement the Servlet Filter API to handle the client requests. 1. Introduction Servlet is a Java program which exists and executes in the J2EE servers and is used to receive the HTTP protocol request, ...

Read More »