With this tutorial we shall explain how to make use of Spring MVC handler interceptors. Handler interceptors are provided by Spring’s handler mapping mechanism, and they can be used to apply a certain functionality to requests. For example, an interceptor may be used to check for a principal. In order to create a handler interceptor, we must make use of ...
Read More »Home » Archives for Theodora Fragkouli »
Spring MVC Handler Mapping Example
This is an example of how to handle URL requests mapping in Spring MVC. In particular, we shall check on three handler mapping classes that Spring MVC provides for handling URL requests. They are all used to define a mapping between URL requests and handler objects. We will create a simple project with a Controller, a view (jsp) and we ...
Read More »Spring 4 REST Hello World Example
In this example we shall show you how to create a simple application to make Rest calls, using the Spring Web MVC framework. Spring Web model-view-controller (MVC) is a Spring support framework for web-based presentation tiers. It provides a model-view-controller architecture and ready components that can be used to develop flexible and loosely coupled web applications. On a previous Spring ...
Read More »Spring MVC Hello World Example
This is an example of the Spring MVC framework. The Spring Web model-view-controller (MVC) is a Spring support framework for web-based presentation tiers. Before creating a simple Hello World example in Spring MVC we shall check on the Spring MVC architecture. The Spring web model-view-controller (MVC) framework provides a model-view-controller architecture and ready components that can be used to develop ...
Read More »Spring 3 Scheduler Example – JDK Timer and Quartz Showcase
Spring Framework provides abstractions for execution and scheduling of tasks, supporting thread pools or delegation to CommonJ within an application server environment. Spring also features integration classes for supporting scheduling with the JDK Timer and the Quartz Scheduler, provided by the Quartz scheduling library. Both schedulers are set up using a FactoryBean with optional references to Timer or org.quartz.Trigger instances, ...
Read More »Spring E-Mail Support – GMail SMTP Server Example
This is an example of Spring E-mail support via the Gmail SMTP Server. The Spring Framework provides a utility library for sending emails. The org.springframework.mail package contains all classes that provide the basic email support of the Spring Framework. Here we use its basic interface for sending emails, that is the MailSender interface. We are also making use of the ...
Read More »Spring Hibernate Integration Example – Mysql and Maven Showcase
In this tutorial we shall show you how to create a simple Spring Hibernate MySql example. The Spring Framework supports integration with Hibernate for resource management, data access object (DAO) implementations and transaction strategies. Here we are using a simple Entity class that is mapped to a database table and we implement the basic CRUD (create- retrieve- update- delete) functionality ...
Read More »Spring JdbcTemplate Example
In this article, we will explain Spring Jdbc Template with examples. When we need to interface with databases the Spring JDBC framework provides solutions to all the low-level details, like open/close a connection, prepare and execute SQL statements, process exceptions, and handling transactions. Thus, the only thing a developer must do is just define connection parameters and specify the SQL ...
Read More »Spring Object to XML Mapper
With this tutorial we shall show you how to convert Objects to xml and vice versa, using Spring’s Object/XML Mapping support. Object/XML Mapping, or O/X mapping for short, is the act of converting an XML document to and from an object. This conversion process is also known as XML Marshalling, or XML Serialization. Within the field of O/X mapping, a ...
Read More »Spring AOP AspectJ Example
This is a tutorial of a Spring AOP AspectJ Example. We will explain how to use AspectJ style support in order to integrate Aspect-Oriented Programming in the Spring framework and we will give a spring aop example. AOP in Spring is used in the Spring Framework to provide declarative enterprise services, especially as a replacement for EJB declarative services. It ...
Read More »