Secure Spring REST API using OAuth2

Let’s secure our Spring REST API using OAuth2 this time, a simple guide showing what is required to secure a REST API using Spring OAuth2. Our use-case fits well with Resource-owner Password Grant flow of OAUth2 specification. We will use two different clients [Postman and a Spring RestTemplate based java application] to access our OAuth2…

Continue reading

AngularJS+Spring Security using Basic Authentication

This post shows how an AngularJS application can consume a REST API which is secured with Basic authentication using Spring Security. Post Secure Spring REST API with Basic Authentication shows in great details how to secure a REST API using Basic authentication with Spring Security. That application will serve as a Back-end for this example….

Continue reading

Secure Spring REST API using Basic Authentication

So You’ve got the REST API for your application, and now you want to secure it. How to do that? There are several popular ways to do that, ranging from Basic Authentication to a full fledged OAuth2 security solution. This Guide explains securing REST API using Basic Authentication with help of examples involving two separate…

Continue reading

Spring 4 Caching Annotations Tutorial

Wondering how to use Caching in your Spring App? Jump right in. This post goes over the caching in detail, explaining commonly used Spring Caching annotationswith examples including @Cacheable, @CachePut, @CacheEvict, @Caching, @CacheConfig & @EnableCaching. A full code example is present at the end of the chapter showing these annotations in action. Post Spring 4…

Continue reading

Spring 4 Cache Tutorial with EhCache

Caching is crucial for today’s high performance hungry applications. Adding Caching in your Spring based application is rather trivial. There are many caching solutions available in market today namely EhCahe, Guava Cache, Caffeine Cache, OScache, JBoss Cache,etc. Spring provides seemless integration with them using minimal configuration. Post Spring 4 Caching Annotations Tutorial contains detailed example…

Continue reading

Spring 4 MVC+JPA2+Hibernate Many-to-many-Example

In this post, we will discuss about JPA2 with Spring and create a full JPA2 complaint persistence layer for our Spring 4 MVC based web application, showing Many-to-many association relationship, right from view till persistence. That means you can choose appropriate JPA2 provider [Hibernate, EclipseLink,..] and later switch between them with only minor configuration changes….

Continue reading

Spring 4 Email using Velocity,Freemarker Template library

Spring provides template libraries which can be used to prepare email templates. Although we can inject the html directly into our email-message, as we saw in previous tutorial, it’s better to keep business logic apart from presentation. Email templates are also the preferred way in Enterprise applications mail sending. Templates can be created separately from…

Continue reading

Spring 4 Email With Attachment Tutorial

Spring provides org.springframework.mail.javamail.MimeMessageHelper class which act as a Helper class for populating a javax.mail.internet.MimeMessage. It offers support for HTML text content, inline elements such as images, and typical mail attachments. In other words, it helps preparing a Multi-part MimeMessage’s. Other interesting posts you may like Secure Spring REST API using OAuth2 AngularJS+Spring Security using Basic…

Continue reading

Spring 4 Email Integration Tutorial

Spring provides first-class support for sending Emails. Spring comes with utility libraries which abstracts away the complexities of the underlying mailing system, provides super-simple API to use in your application to send emails. Other interesting posts you may like Secure Spring REST API using OAuth2 AngularJS+Spring Security using Basic Authentication Secure Spring REST API using…

Continue reading

Spring 4 MVC + JMS + ActiveMQ annotation based Example

Spring provides first-class support for JMS, enabling applications integration using standard based messaging. In this post, we will build Spring 4 MVC application communicating with another Spring-based application, using JMS through Apache ActiveMQ. For a general introduction on JMS itself, please refer to post Spring 4 + JMS+ActiveMQ Annoataion based Example. We will try to…

Continue reading