MVC

Spring MVC @PathVariable dot(.) get truncated Example

In spring, the @PathVariable annotation is used to bind the uri template variables in the spring mvc framework. But there is one issue i.e. if the passed parameter has a value with a dot in it (for e.g. xxx.xx) then the portion after the last dot (.), including dot, gets truncated. In this tutorial, we will explore a way to ...

Read More »

Spring MVC and Angular 6 Example

Welcome readers, in this tutorial, we will show the Angular 6 Http Client module and Spring MVC example to fetch the model data. Here, we are using Angular 6 as a front-end technology to make a request and receive the response. 1. Introduction Refer below diagram to understand the spring mvc and angular 6 applications. The two different applications interact ...

Read More »

Spring MVC Pagination Example

Pagination is a mechanism to display a large number of records in different parts. In this tutorial, we will show how to implement the pagination functionality in the spring mvc framework. 1. Introduction Spring is an open-source framework created to address the complexity of an enterprise application development One of the chief advantages of the Spring framework is its layered ...

Read More »

Spring MVC ModelMap Example

In spring mvc, the org.springframework.ui.ModelMap object is used to pass the multiple values from the spring controller to the view. In this tutorial, we will show how to implement the org.springframework.ui.ModelMap object with the spring mvc framework. 1. Introduction 1.1 Spring Framework Spring is an open-source framework created to address the complexity of an enterprise application development One of the ...

Read More »

Spring MVC @ControllerAdvice Annotation Example

Unexpected exceptions or errors can be thrown anytime during the execution of a program. In the previous post, we have already seen how the @ExceptionHandler annotation can only be applied to a single controller but what if developers want to handle the exception globally i.e. across multiple controllers. Thus, in this tutorial, we will show how to do the exception ...

Read More »

Spring MVC 4 AngularJS Example

This tutorial is about integration of AngularJS with Spring MVC version 4. Before proceeding with this article, we assume readers have a working knowledge of Java and its frameworks. We will see how AngularJS will request the data through the HTTP protocol and we will write a Restful web service that returns response in JSON format. 1. Introduction Spring MVC ...

Read More »

Spring MVC @ExceptionHandler Annotation Example

In this post, we feature a comprehensive Example on Spring MVC @ExceptionHandler Annotation. Unexpected exceptions or errors can be thrown anytime during the execution of a program. Spring MVC framework provides three different approaches for handling the exceptions i.e. Using XML based configuration by declaring the SimpleMappingExceptionResolver bean in the Spring’s application context file and mapping the exception types with ...

Read More »

Spring MVC Form Validation Example

Validation and Submission of a form is an important aspect of a web application. In this tutorial, we will show how to validate the form fields of a simple login form using the Spring MVC framework. 1. Spring MVC Form Validation – Introduction 1.1 Spring Framework Spring is an open-source framework created to address the complexity of an enterprise application ...

Read More »

Spring MVC Internationalization Example

Internationalization (I18N) represents a process of designing an application for the global market. In order words, it is a process of designing an application that can be adapted to various languages and regions. In this tutorial, we will show how to implement internationalization using the Spring MVC framework. 1. Introduction 1.1 Spring Framework Spring is an open-source framework created to ...

Read More »

Spring MVC Interceptors Example

In this post, we feature a comprehensive Example on Spring MVC Interceptors. In spring, interceptors provide a powerful mechanism to intercept an HTTP request. In this tutorial, we will show how to implement the interceptors with the Spring MVC framework. 1. Introduction 1.1 Spring Framework Spring is an open-source framework created to address the complexity of an enterprise application development ...

Read More »