Spring-MVC Sample

As I described in the previous segment, spring-mvc is a framework that is really useful in developing web-applications. So, to demonstrate the abilities of Spring-MVC lest start with a sample application for library-management-system and understand the building boxes of Spring-MVC.

Initializing Project

  1. In this sample project we will use ‘Maven’ as our dependency management tool. So, initialize a maven-project and add the dependency for ‘spring-mvc’ in the ‘pom’ file.
  2. Then Create a directory-structure as follows :

Configurations for Spring-MVC

First of all as I explained in the last chapter we have to map the servlet which our application going to fit. To that we have…

What is Spring-MVC ?

Spring-MVC is a framework that offers Model-View-Controller Architecture to build loosely coupled and flexible web-applications. MVC Pattern separates the concerns of Business-Logic, Model and UI components so that can evolve themselves without distracting other components. Lets take a look at what is actually Model-View-Controller in this architecture.

  • The Model encapsulates the application data and in general they will consist of POJO.
  • The View is responsible for rendering the model data and in general it generates HTML output that the client’s browser can interpret.
  • The Controller is responsible for processing user requests and building an appropriate model and passes it to…

Git Branching

Git is a free and open source distributed version control system designed to handle from small to very large projects with efficiency. Git is really easy to use and learn. In this article we are going to cover one important aspect of Git which is called Branching.

Git Branches are separate, independent line of development in a collaborative project. The first branch in every project is called ‘master-branch’. Branching is very useful in a research and development project as many developers might work in many features of the final product. …

If you are a programmer, Design Pattern are some main aspects that you need to study and grow up on. Even though number of Design-Pattern exists in this article we are going to explore a Behavioral Design Pattern called State Pattern.

According to Wikipedia state pattern is a behavioral software design pattern that implements a state machine in an object-oriented way. With the state pattern, a state machine is implemented by implementing each individual state as a derived class of the state pattern interface, and implementing state transitions by invoking methods defined by the pattern’s super-class.

If you are familiar…

In my previous article I have given a brief introduction on Ballerina Programming Language. But I could not give a heads up on how to setup Ballerina in your local environment.

To setup Ballerina we could try out few approaches:

  1. Using OS specific installers
  2. Using public binaries for Ballerina distribution
  3. Building Ballerina from Source

Here, first two approaches are quite straightforward. But building Ballerina from sources in not quite straightforward. So, in this article we would take a closer look on how we could do this.


Download and Setup OpenJDK 11 (Adopt OpenJDK or any other OpenJDK distribution)

  • Info: You…

Reactive Programming is the newest trend in programming world. In this article series of Spring Webflux I have been discussing on how to build a Reactive Application using Spring Webflux. In the Part 2 we have discussed how to build a simple reactive application using Spring Boot. Lets dig deep into more advanced routing methods and filter functions in this article.

Context Path for Application

In Spring MVC can give a context path to our application. In Spring Webflux we don’t have a configuration for that. But we can set a context-path for multiple routes. Following is how we can do that.


Reactive Programming is one of the most popular programming paradigms now a days. Spring Webflux is the newest flavor of Spring Framework with the taste of Reactive Programming. In my first article I have discussed about the building boxes of . So, in this article we will build a simple application with Spring Webflux.

Application Structure

We will create a Spring-boot Application as a Maven Project. Add the following dependencies to Maven-POM.

Annotate the Spring-Boot-Application class with @EnableWebFlux. Adding this annotation to an ‘@Configuration class’ or ‘Spring-Boot-Application class’ imports the Spring Web Reactive configuration from WebFluxConfigurationSupport.

Building the Application

Spring-Boot is so simple…

Spring is one of the most popular frameworks used by Java-Developers. Manageable learning curve of Spring has lift it to the top of most-used Java-Framework through out the world. The latest of Spring Family has arrived recently with the flavor of Reactive-Programming in-built to it. This article series is about building a robust-reactive API using spring-webflux.

What is Reactive-Programming ?

Reactive Programming is a programming paradigm where you program with asynchronous-data-streams. In Imperative-Programming we get the data and perform actions on it. But in Reactive-Programming we don’t wait for data to present to perform actions rather we instruct what to do when data is…

Computer Programming is the process of creating instruction that can tell a computer to execute some tasks. Basically we can identify three types of computer programs in modern world. Namely Transformational Programs, Interactive Programs and Reactive Programs. Transformational Programs are pretty simple. They take set of inputs and produce an output. Interactive is bit different which interacts with users and other programs in its own speed and produce outputs. Reactive is also interacting with users and produces outputs, this time around not in its speed but in the speed of the user.

Reactive Programming is where you implement computer programs…

Ballerina is an open-source general purpose programming language which is developed by WSO2. In my previous article we discussed on how we could write a Hello World program in Ballerina. Let’s take a closer look at the data types available in Ballerina.

Ballerina has built around the concept of Plain Data.

Plain Data is data that is independent of any specific actions operating on the data. Objects which contain both data and actions to be performed on that data are not considered as plain data.

Plain Data supports deep copy and deep equality. …

Ayesh Almeida

A Tech Enthusiast who wants to build simple solutions for complex problems.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store