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…