Home » Author Archives: Yatin Batra

Author Archives: Yatin Batra

Yatin Batra

Yatin has graduated in Electronics & Telecommunication. During his studies, he has been involved with a large number of projects ranging from programming and software engineering to telecommunications analysis. He works as a software developer in the information technology sector where he is mainly involved with projects based on Java and J2EE technologies platform.

Java Servlet Hidden Field Example

A hidden form field is a technique used to store the session information for a particular client and is one of an important Session Tracking Technique. In this tutorial, we will explain and show you how to handle the hidden fields in a Servlet. 1. Introduction Session Tracking is a technique to maintain the requests of the same user for a ...

Read More »

Java Servlet onclick Example

Servlets are modules of the Java code that run in 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. The word “Servlet” is often used in the meaning of “HTTP Servlet“. In this tutorial, we will explain and show you how to call a Servlet ...

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 like below. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, ...

Read More »

Java Servlet AsyncListener Example

Async Servlet was introduced in Servlet 3.0. In this section, you will learn about registering AsyncListener with the recently created AsyncContext with an example. The AsyncListener will be notified when an asynchronous event occurs. 1. Introduction AsyncEvent contains the details of the event occurred by the Asynchronous processes. These events include the successful completion of the asynchronous cycle, times out, ...

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 »

JSF 2 and Log4j Integration Example

Log4j is a popular and widely-used logging framework for the Java development. It’s pretty easy to setup and use the Log4j mechanism in a JSF application. In this tutorial, I will show you how to implement the logging functionality with the JSF framework. 1. Introduction 1.1 JSF Framework JSF is an Mvc framework that eases the user interfaces for server-based ...

Read More »

Hibernate SQL Parameter Values using Log4j Example

When using Hibernate, if developers log the Hibernate SQL statements, they will see something like this: Hibernate: insert into student (id, first_name, last_name, email) values (?, ?, ?, ?) However, for debugging the application, developers want to see the actual parameter values in the Hibernate logs i.e. basically, they want to get rid of the question marks in the logs. ...

Read More »