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 readingMonth: July 2016
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 readingSecure 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 readingSpring 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 annotations with examples including @Cacheable, @CachePut, @CacheEvict, @Caching, @CacheConfig & @EnableCaching. Let’s get going. A full code example is present at the end of the chapter showing these annotations in…
Continue readingSpring 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 EhCache, Guava Cache, Caffeine Cache, OScache, JBoss Cache,etc. Spring provides seamless integration with these caching solution using minimal configuration. Post Spring 4 Caching Annotations Tutorial contains…
Continue readingSpring 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 readingSpring 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 readingSpring 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. Let’s get going. Other interesting posts you may like Spring Boot+AngularJS+Spring Data+Hibernate+MySQL CRUD App Spring Boot…
Continue readingSpring 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. Let’s get going. Other interesting posts you may like Spring Boot+AngularJS+Spring Data+Hibernate+MySQL CRUD App Spring Boot WAR deployment example Spring Boot REST…
Continue reading