Hibernate One to One Annotation Example

  In this example, we will see how to perform one to one mapping in Hibernate using annotations. We will use the Hibernate One to One XML Mapping Example  and enhance it to support Hibernate annotations.   1. Technologies used Hibernate 4.3.6.Final MySQL 5.1 Maven…

Maven Hello World Example

In this tutorial, we will install and configure Maven on Windows. Then we will create our first project using Maven.   1. Technologies used Java 1.6 Maven 3.0.5 Windows 8 Eclipse 4.4   2. Java configuration Install JDK and in environment…

Mule ESB Hello World Example

  Mule ESB is a Java-based Enterprise Service Bus (ESB) that allows to implement communication between applications in a service oriented architecture (SOA). In this example, we will create a simple Mule application to implement the following flow : The flow…

Struts 2 Annotations Example

  To configure Struts 2 applications (action names, mapping, results,..), we can use either XML file (struts.xml) or annotations. In this example, we will see how to use annotations in Struts 2 application to define and configure an action class….

Spring Setter Injection

  In Spring, the beans are managed by the core container : initialization, dependency injection and life cycle. To configure Spring container, we can use either XML file or annotations. The dependency injection (DI) is either performed via Setter injection…

JAX-WS Hello World Example

  JAX-WS (Java API for XML Web Services) is a Java API for developing web services and clients. In this example, we will use JAX-WS to create : a web service to expose a simple method, and a client to consume this method. The service…

JSF 2.2 Managed Beans

  In a JSF 2.2 application, the managed bean plays both the role of controller and model. In this example, we will see two ways to create and configure managed beans in an application.   1. Technologies used JSF 2.2.8 Maven…

Java read file with BufferedReader

  In this example, we will see how to use one of the basic Java IO operations, which is reading a file with BufferedReader class. The principle is to use a buffer whose size can be parametered, so instead of reading character…