Home » Archives for Yatin » Page 30

Author Archives: Yatin

An experience full-stack engineer well versed with Core Java, Spring/Springboot, MVC, Security, AOP, Frontend (Angular & React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).

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 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 ...

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 »

Spring MVC File Download Example

Hello readers. Spring framework provides an out of box support for the file download functionality from the server to a local machine. In this tutorial, we will show you how to implement the file download functionality with the Spring Mvc framework. To handle the file download capability in a web application, we will use the HttpServletResponse to directly write a ...

Read More »

Spring MVC using Log4j 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 Spring Mvc application. In this tutorial, I will show you how to implement the logging functionality with the Spring Mvc framework.               1. Introduction 1.1 Spring Framework Spring is an ...

Read More »