jQuery AJAX based Registration System using Python Flask MySQL

Introduction This guide will walk you through how to build jQuery AJAX based registration system using Python Flask MySQL. In this example I am going to build REST API that will be called from front-end technologies – jQuery, HTML including AJAX technique. We will determine registration process based on various http status codes such as 200 – success, 400 – bad request, 409 – conflict. We will also use template from Flask API to render the sign up page where input fields will be displayed for entering user details. We…

Continue

Validate Email Address with Regular Expression using Kotlin

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 address before sending email to those particular emails for safety purpose. Here we will use regular expression (regex) to validate email address using Kotlin programming language. We will also see how to create Kotlin project…

Continue

HackerRank Solution: Valid Username 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, etc. So here also we have some certain rules for choosing the username and we will check valid username regular expression in Kotlin language. Please read here how to create Kotlin project in Eclipse.

Continue

Spring MVC Bean Validator

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 constraints in the form of annotations placed on a field, method, or class of a JavaBeans component, such as a managed bean. Constraints can be built in or user defined. User-defined constraints are called custom…

Continue

Spring Web MVC @PathVariable with Regular Expressions

This tutorial will show you how we use @PathVariable annotation with Regular Expressions in Spring Web MVC. Sometimes you need more precision in defining URI template variables. The @RequestMapping and @GetMapping annotations support the use of regular expressions in URI template variables. The syntax is {varName:regex} where the first part defines the variable name and the second – the regular expression. For example, with @RequestMapping: Or with @GetMapping annotation:

Continue

Verify a string contains only numeric value in Java

Introduction The below example shows how to verify that a string contains only numeric value in Java. String may contain float value, double value etc. This example uses regular expression to check a string contains only numeric values. It makes sure that your string should contain only digits and dot(.). You may need sometimes to use string variable for storing numeric data. As the variable is string type, so by mistake your string variable may contain non-numeric values which are not correct values for processing further business logic. Therefore you…

Continue