Introduction Here in this tutorial I am going to show you how to use AJAX technique using jQuery with Spring Boot application to check user availability instantly without refreshing the web page. I am going to use Thymeleaf template in Spring Boot application. I will use Spring REST to create REST API endpoint which will…

Posted in AJAX jQuery Spring Boot Spring REST

Spring Boot AJAX jQuery to check User Availability Instantly

Introduction In this example I am going to show you how to allow only numeric values or digits in input field using React JS. You may have a requirement where you only need to allow user digits or numeric values for the input field. If user inputs non-numeric values then either you show an error…

Posted in React JS

Allow only numeric values or digits in input field using React

In this tutorial I am going to show you how to allow users only input numeric values or digits. If users enter non-numeric value then we will show an error message. We can also completely prevent from entering non-numeric values. In this case, we need to accept only numbers for a textbox or input field…

Posted in Angular

Allow only numeric values or digits in input field using Angular 10

Introduction In this example we will see an example on how to validate form in web application using Spring Boot framework. We will use Thymeleaf as a template for UI (user interface) or front-end. We will perform almost all kinds of validations available through Hibernate validator framework. This example just validates the input values and…

Posted in Hibernate Spring Boot

Form Validation in Spring Boot Web Application

Introduction We will see how to validate a value is numeric or not in Python programming language. Situation may occur when you need to validate the input field’s value is numeric or not. The input field on the form may accept anything unless otherwise you have a client side validation. The user may input anything…

Posted in Python

How to validate value is numeric using Python

Introduction This tutorial will show you how to validate email address with regular expression using Kotlin. In this post, email validation in Kotlin will be done using regular expression or regex pattern. In web applications or standalone applications where we need to send emails to intended recipients, it is recommended to check the valid email…

Posted in Kotlin

Validate Email Address with Regular Expression using Kotlin

This tutorial will show you how to solve HackerRank Valid Username Checker using Kotlin. In different web applications we define certain rules for choosing the username, such as, it should consists of maximum 30 characters; it should not have any special character; it may contain one or more digits; it must starts with a letter,…

Posted in Kotlin

HackerRank Solution: Valid Username Regular Expression using Kotlin

Introduction In my previous tutorial I have shown how to validate input data coming from client or end user to Spring REST Controller. Now in this tutorial I will show you how to validate data in Spring Service Layer. The reason behind validating input data in Service Layer is, input data from client may not…

Posted in Spring MVC Spring REST

Spring Service Layer Bean Validation

In this example, I will show you how to build a bean validator for User model object.In my previous example,┬áSpring MVC Custom Validator, I have shown how to validate user input. Validating input received from the user to maintain data integrity is an important part of application logic. The Bean Validation model is supported by…

Posted in Spring MVC

Spring MVC Bean Validator

In this example, I will show you how to build a custom validator for User model object. This validator is custom implementation of Validator interface. Spring MVC supports validation by means of a validator object that implements the Validator interface. I will write the below validator code in this example to check if the required…

Posted in Spring MVC

Spring MVC Custom Validator

Introduction Here I am going to tell you how to sanitize JSON (JavaScript Object Notation) string using Java program. Given JSON-like content, convert it to valid JSON. The OWASP JSON Sanitizer Project is a simple to use Java library that can be attached at either end of a data-pipeline to help satisfy Postel’s principle: be…

Posted in Java

Sanitize JSON using Java

Introduction The example – allow only numeric values or digits in a textbox using javascript or jquery – shows how to accept only numbers or digits in a textbox or input field using JavaScript or jQuery. Sometimes you need to accept only numbers for a textbox or input field instead of validating the value in…

Posted in JavaScript jQuery

Allow Only Numeric Values or Digits in a TextBox using JavaScript or jQuery