Sanitize JSON using Java

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 conservative in what you do,…

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

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 the textbox or input field….

Email address validation example in PHP

Introduction This example will show you how to validate email address using PHP programs. The email validation is an important part of the web application when you deal with email address otherwise invalid or bad email address may be stored in your server system. Email address is an important part of the application because for many situations you need to…

Custom Validation Example In Codeigniter 3

Table of Contents Introduction Prerequisites Project Directory Auto-load Configuration REST Controller Route Configuration Testing Custom Validation Home Page Validation Error Validation Success Source Code Introduction This tutorial shows how to work with custom validation in Codeigniter. You need many times that a field has to be validated against some type of values but built-in features do not provide all kind…

SunCertPathBuilderException: unable to find valid certification path to requested target

Introduction This issue occurs while establishing a trusted connection over SSL (Secure Socket Layer) in Artifactory. The error message indicates that Artifactory could not establish a trusted connection over SSL. You may find this issue if you are using Self-Signed certificate or a certificate that is issued by an internal Certificate Authority or if your clients (e.g. browser, java) are…

Verify A String Contains Only Numeric Value Using 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…