Struts 2 Bean Tag Example

In Struts 2, the  “bean” tag is used to create a Java class and place it in the stack’s Context. In this lesson, we will use the “bean” tag to instantiate a Java object inside a JSP page, and then display the content…

Hibernate Transaction Management Using Spring

In Hibernate, communication with the database always occurs through a database transaction. A Hibernate application can run in : non-managed environment : the developer needs to manage the database transactions himself by manually setting the begin, commit or rollback. managed…

Spring Security Remember Me Example

In this lesson, we will see how to implement the Remember-me authentication so that our web application will be able to remember its users between sessions and allow them access without needing to log in every time. In our case, we…

Spring MVC Validator Example

Spring MVC provides a Validator interface that we can use to validate objects. In this lesson, we will see how to perform validation within Spring MVC using the Validator interface.   1. Technologies used Spring 4.2.0.RELEASE Maven 3.0.5 Eclipse 4.5 JDK 1.6 Tomcat 7.0…

Struts 2 Custom Interceptor Example

Generally, the default interceptors are sufficient for most applications, however, we can still create our own interceptor when we need to implement more specific action processing. In this example, we are going to see how to write a custom interceptor…

Spring Security Concurrency Control Example

In this example, we will see how to use Spring Security to add support for concurrent session control to limit the number of active sessions a user can have.   1. Technologies used Spring Security 3.2.5.RELEASE JSF 2.2.8 MySQL 5 Maven 3.0.5 Eclipse 4.4…

JSF 2 RichFaces 4 Example

RichFaces is an UI component framework for integrating Ajax capabilities into JSF web applications. In this tutorial, we are going to use some of RichFaces features in a JSF 2 web application to build a registration form.   1. Technologies used JSF…

Monitoring Java application with AspectJ and JAMon

JAMon (Java Application Monitor) is a Java API used to monitor the performance of Java applications. Aspect-oriented programming (AOP) is a way of modularizing crosscutting concerns, such as monitoring, logging, error handling, ..etc. AspectJ is an implementation of aspect-oriented programming for…

Spring MVC data binding list example

In this tutorial, we will see how to perform data binding to a list; we are going to map fields in a page form to a list elements in a form backing object.   1. Technologies used Spring 4.2.0.RELEASE Maven 3.0.5 Eclipse 4.4 JDK 1.7 Tomcat…