Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

and many more ....

 

Android HTTP Client : Network error and ConnectivityManager

android-logo

In this post I will show how to handle connection errors or the situation when the connection changes (i.e from UMTS to WI-FI). In all these cases we have to gracefully handle these errors and implement some strategies to try to reconnect if possible. In a perfect world when we connect to a remote server with HTTP protocol everything works ...

Read More »

Unit Testing of Spring MVC Controllers: REST API

spring-interview-questions-answers

Spring MVC provides an easy way to create REST APIs. However, writing comprehensive and fast unit tests for these APIs has been troublesome. The release of the Spring MVC Test framework gave us the possibility to write unit tests which are readable, comprehensive and fast. This blog post describes how we can write unit tests for a REST API by ...

Read More »

Mediator Design Pattern in Java – Example Tutorial

java-logo

Mediator Pattern is one of the behavioral design pattern, so it deals with the behaviors of objects. Mediator design pattern is used to provide a centralized communication medium between different objects in a system. According to GoF, mediator pattern intent is: Allows loose coupling by encapsulating the way disparate sets of objects interact and communicate with each other. Allows for ...

Read More »

Memento Design Pattern in Java – Example Tutorial

java-logo

Memento pattern is one of the behavioral design pattern. Memento design pattern is used when we want to save the state of an object so that we can restore later on. Memento pattern is used to implement this in such a way that the saved state data of the object is not accessible outside of the object, this protects the ...

Read More »

Neo4j Java REST Binding – Part 2 (Batching)

neo4j-logo

In Part 1, we talked about setting up a connection to the Neo4j Server using the Java REST Binding. Let’s now go into some details about transactions, batching, and what the REST requests really look like.Make sure you turn on logging (set system property org.neo4j.rest.logging_filter to true) as described in Part 1. We will change our code to  execute these ...

Read More »

Asynchronous retry pattern

java-logo

When you have a piece of code that often fails and must be retried, this Java 7/8 library provides rich and unobtrusive API with fast and scalable solution to this problem:                   ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); RetryExecutor executor = new AsyncRetryExecutor(scheduler). retryOn(SocketException.class). withExponentialBackoff(500, 2). //500ms times 2 after each retry withMaxDelay(10_000). //10 ...

Read More »

File Upload Example in Servlet and JSP

java-interview-questions-answers

Uploading File to server using Servlet and JSP is a common task in Java web application. Before coding your Servlet or JSP to handle file upload request, you need to know little bit about File upload support in HTML and HTTP protocol. If you want your user to choose files from file system and upload to server than you need ...

Read More »

ADF: URL Task Flow Call with HTTP POST Method

java-interview-questions-answers

As we know a bounded task flow can be invoked by some URL either directly from a browser or from some external application. This feature is enabled if task flow’s property “URL invoke” is set to “url-invoke-allowed” and it is commonly used in integration projects. Usually clients (or invokers) use HTTP GET method and pass their parameters in the URL. ...

Read More »

A Simple Plugin System for Web Applications

java-interview-questions-answers

We need to make multiple web-based projects with a lot of shared functionality. For that, some sort of a plugin system would be a good option (as an alternative to copy-pasting stuff). Some frameworks (like grails) have the option to make web plugins, but most don’t, so something custom-made is to be implemented. First, let’s define what is the required ...

Read More »

Sometimes TDD Requires a Hammer

software-development-2-logo

While there are myriad mocking libraries available for the Java platform, only a select few of these nifty frameworks is capable of mocking the non-mock-friendly modifiers of static and final. Static (or class) methods, while handy for factories, become a nuisance for a framework like Mockito, however, with the inclusion of PowerMock, you’ve got yourself a proverbial hammer. As I ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close