Custom Jackson Joda DateTime Serializer

This tutorial shows how to serialize date format when marshaling JSON using Jackson. The custom annotation will be created in order to pass the date format using annotation.

Detect Operating System Using PHP

Introduction In this example I will show you how to detect Operating System using PHP technology. I am going to use browser’s HTTP_USER_AGENT that gives lots of information about the operating system, but here I will only detect operating system type, such as, Windows, Mac, Linux, Ubuntu, Mobile etc. I won’t list down further details, such as, what is the…

@PreAuthorize annotation – hasPermission Example In Spring Security

Spring Security Has Permission In this tutorial I will show you an example on @PreAuthorize annotation – hasPermission() example in Spring Security. The most useful annotation @PreAuthorize, which decides whether a method can actually be invoked or not based on user’s role and permission. hasRole() method returns true if the current principal has the specified role and hasPermission() method returns…

@PreAuthorize Annotation – hasRole Example In Spring Security

Spring Security Has-Role In this tutorial I will show you an example on @PreAuthorize annotation – hasRole() example in Spring Security. @PreAuthorize is the most useful annotation that decides whether a method can actually be invoked or not based on user’s role. hasRole() method returns true if the current principal has the specified role. By default if the supplied role…

Creating Multi Modules Maven Project in Eclipse

Multi Module Project In this tutorial I will explain you how to create multi-modules maven project in Eclipse. This kind of project is a good design when you want to group similar applications or projects and reduce the duplication in code. A multi-module project is built from a parent pom that manages a group of submodules. In most cases, the…

How to create Custom Thread Pool in Java

Introduction In this tutorial I am going to show how to create custom thread pool in Java. Multi-threaded and multi-process programmings are great ways to optimize CPU usage and get things done quickly. What is thread pool? Thread pool is a collection of already created worker threads ready to perform certain tasks. Instead of creating and discarding thread once the…

Remove version from css & js files in WordPress

In this post I will show how you can remove version from CSS & JS files in WordPress. Almost all css and js files in the WordPress have the WordPress version number appended after the file names or using a query string. Having query string with the URL browser does not cache the file because the file is treated as…

Spring Service Layer Bean Validation

Introduction In my previous tutorial I have shown how to validate input data coming from client or end user to Spring REST Controller. Now in this tutorial I will show you how to validate data in Spring Service Layer. The reason behind validating input data in Service Layer is, input data from client may not always pass through the REST…

Convert PDF To Image File Using Java

Introduction This tutorial will show you how to convert pdf to image file using Java. For this I am using here pdfbox API. Java pdf to image example will show you step by step conversion procedure from PDF file to image file. In the recent version (2.0.20) of the pdfbox library many methods were removed along with getAllPages() and convertToImage()…

Conditional Statement in Spring Config

Sometimes we may need to have some conditional statement in Spring config XML file depending upon some variables value. Think of a situation when you are using JPA in your application and your application may have two persistence units in Spring XML config file and you need to connect to one of them depending upon the environments. Here conditional statement…