In this post under Apache excel, I will show with example how to add header and footer to an Worksheet. Below is the complete code for your reference. Main Class 1 package package5; 2 3 import java.io.BufferedReader; 4 import java.io.File; 5 import java.io.FileOutputStream; 6 import java.io.FileReader; 7 import java.io.IOException; 8 9 import org.apache.poi.xssf.usermodel.XSSFCell; 10 import…… Continue reading Creating a header and footer for a worksheet
Month: April 2023
Configuring RetryTemplate (using Interceptor)
In the previous post under Spring Retry –> XML Configuration –> Spring AOP, I showed with example how to configure Spring Retry using interceptor. In that post I used RetryOperationsInterceptor class as shown in the below snippet. <bean id=”retryAdvice” class=”org.springframework.retry.interceptor.RetryOperationsInterceptor”/> In the above code snippet, I created a bean of RetryOperationsInterceptor which will create a…… Continue reading Configuring RetryTemplate (using Interceptor)
Asynchronous REST api call using JAX-RS Client api (Part 2)
In the previous post under JAX-RS Client, I showed with example, one way of making asynchronous request for a resource using JAX-RS api. In this post, I will show another way in which we can achieve the same thing. In the first approach, once we made the asynchronous call, we were continuously looping, checking the…… Continue reading Asynchronous REST api call using JAX-RS Client api (Part 2)
Asynchronous REST api call using JAX-RS Client api (Part 1)
Till now in all my previous posts under JAX-RS client, the examples I showed made synchronous call to REST resource using JAX-RS client api. In this post under JAX-RS client, I will show with example how to make an asynchronous call to REST resource using JAX-RS client api. Below is the complete code for your…… Continue reading Asynchronous REST api call using JAX-RS Client api (Part 1)
Setting Cookies using JAX-RS client
In this post under JAX-RS I will show with example how to set cookies, when making REST api calls, using JAX-RS client api. Below is the complete code for your reference. Main Class 1 package defaultPackage; 2 3 import jakarta.ws.rs.client.Client; 4 import jakarta.ws.rs.client.ClientBuilder; 5 import jakarta.ws.rs.client.Invocation; 6 import jakarta.ws.rs.client.WebTarget; 7 import jakarta.ws.rs.core.Response; 8 9 public…… Continue reading Setting Cookies using JAX-RS client
Setting ACCEPT header using JAX-RS client
In this post under JAX-RS I will show with example how to set ACCEPT header when making REST api calls using JAX-RS client api. Below is the complete code for your reference. Main Class 1 package defaultPackage; 2 3 import java.util.Locale; 4 5 import jakarta.ws.rs.client.Client; 6 import jakarta.ws.rs.client.ClientBuilder; 7 import jakarta.ws.rs.client.Invocation; 8 import jakarta.ws.rs.client.WebTarget; 9…… Continue reading Setting ACCEPT header using JAX-RS client
Setting headers in JAX-RS Client
In this post under JAX-RS Client, I will show with example how to set headers when sending the REST request. Below is the complete code for your reference Main Class 1 package defaultPackage; 2 3 import jakarta.ws.rs.client.Client; 4 import jakarta.ws.rs.client.ClientBuilder; 5 import jakarta.ws.rs.client.Invocation; 6 import jakarta.ws.rs.client.WebTarget; 7 import jakarta.ws.rs.core.Response; 8 9 public class Example8 {…… Continue reading Setting headers in JAX-RS Client