Any modern java web application cannot be thought of creating without spring. It's not like it is not possible to create but coding in a plain servlet is a pain. Spring MVC provides clear separation and excellent integration between all the modules. The different annotations such as @Component, @Controller and many more have really made developer life easier while dealing with java web application.
In the below tutorials we have tried to cover all the topics that are required to develop a java web application using spring mvc.
Spring MVC Content Negotiating Viewresolver Example(Json, XML, HTML)
This tutorial explains about contentnegotiatingviewresolver in spring mvc using annotations and java configs. Here we will have a single controller that can produce responses in different data format such as json, html or xml etc. based on the request url without creating any extra layers. We only require to have contentnegotiatingviewresolver configurations that will do this for us. Now, let us implement this with the following spring mvc contentnegotiatingviewresolver example. In this example we will have responses in json, xml and html based on the request file name....
Read now➤
Spring Azure Blob Storage
In this article, we will be discussing creating a storage account on Microsoft Azure and create a sample spring-mvc based java application to perform different operations on Azure blob storage....
Read now➤
Exception Handling In Spring Soap Client
WebServiceTemplate already handles an exception in a perfect way but sometimes it is required to add our custom logic while executing the exception callbacks as most of the web services are designed in a such a way that exceptions are thrown in a custom fashion. For example, many web services tend to provide a status of 200 even during exceptions and there is a nested status code which actually tells about the exception. In that case, default exception handling provided by WebServiceTemplate is unable to handle that....
Read now➤
AWS S3 Java
In this tutorial, we will discuss AWS S3 and create a sample java application to perform different file operations such as folder create, read, write and delete files from an AWS S3 bucket. We will start from creating an S3 bucket on AWS, how to get access key id and secret access key of Amazon S3 account and then use these keys in our spring application to perform different operations on S3....
Read now➤
Storing Hashed Password to Database in Java(Using Bcrypt)
Storing passwords in plain text in databse is vulnerable to security. This article is about storing hashed password to databse in java. Doing so it becomes impossible for even BDAs to extract the real passwords. There are many hashing algorithms such as MD5, SHA-1, SHA-2 etc to hash a password but adding a salt to the password provides extra security. In this article we will be using jBCrypt, which internally generates a random salt while encoding passwords, to encode our plain text passwords and store in DB....
Read now➤
Spring MVC PDF and Excel View Example (using iText)
This tutorial explains about generating PDF and excel documents in Spring web mvc using iText PDF library. It uses the content negotiation view resolver provided by spring to generate PDF and excel views. Here we will be creating a simple spring mvc web application using annotations and java configs. This application will be capable of negotiating views between pdf and excel based on the HTTP request. If you are looking for json, xml and html content view resolver then...
Read now➤
Spring JMS Example + ActiveMQ + Annotation/ JavaConfig
Today let us integrate JMS and Spring with activemq with an example. This will be a simple JMS producer and consumer app. Before we start let's make some concepts clear. Java Message Service (JMS) is an application program interface (API) that supports the formal....
Read now➤
Spring MVC annotation Example with JavaConfig
This tutorial aims to provide a complete guide for spring mvc. We will be developing a web app using spring mvc and try to learn spring mvc architecture, its configurations and different concepts involved while creating a spring mvc annotation example. All the configurations will be based on annotations and java config and we will be overriding methods defined in WebApplicationInitializer and WebMvcConfigurerAdapter class to achieve this....
Read now➤
Different AOP Terminologies and Keywords
In this post, let us discuss about different Aspect Oriented Programming(AOP) terminologies which will help to understand the upcoming spring AOP tutorials.It is very much important to understand the basic AOP terms and usage first to understand the internals of AOP, it's implementation and usage using Spring framework.The AOP terminologies described here are not specific to...
Read now➤
Spring 5 Features and Enhancements
As we all must be knowing the second milestone of Spring Framework 5.0 got released in September last year as a new functional web framework.It is completely based on Reactive Programming Model.Spring Framework 5.0 has many major enhancements and upgrades with Java 8 as a minimum...
Read now➤
Caching in Spring Example + Ehcache + Cacheable + Annotation/JavaConfig
As we know EhCache is a widely used caching library. Spring provides easy annotation based integration mechanism of ehcache using @Cacheable. Here we will be creating a sample application which will use @Cacheable annotation to cache the user detail. We will try to fetch the same user detail again and again and compare the time required t fetch it. The spring configuration...
Read now➤
Writing Junit Tests with Spring4 Mvc
Today we will take a look into writing Junit test cases with Spring Mvc
. We will be creating a sample Spring MVC
app with hibernate and write few test cases using Junit
and clear our...
Read now➤
spring4 hibernate integration example + annotation / Java Config
There are numerous spring hibernate intgration example available on the web but most of them are not using java configuration. But many spring app these days are being developed using java config. Hnce, today we will be dicussing about spring hibernate integration with complete java configguration, no xml at all.
This post can be considered as an upgradation of my previous post where we discussed Spring AngularJS intgration but without DB connection...
Read now➤