Spring Boot Internationalization Example

Spring Boot Internationalization Example will show you how to make an web based application in different languages. Internationalization or Localization will show you the web page content based on your choosen language in which you want to view the page.

I will show here how we can switch in different langugaes like Bengali, Hindi, English, Dutch and French. You don’t need to change the language settings from the browser for switching to different languages. You are given an option to choose a language in a dropdown where the langugaes are displayed in Bengali, Hindi, English, Dutch and French. If you want you can add more languages or remove languages and accordingly you need to create separate properties file for each language and put them under classpath directory.

This application shows title, welcome message, choose language option and copyright information in Bengali, Hindi, English, Dutch and French languages. By default the selected language is English.

You may also would like to read JSF 2 Internationalisation Example

Continue reading “Spring Boot Internationalization Example”

Spring Boot Internationalization Example was last modified: May 24th, 2018 by Soumitra Roy Sarkar

SOAP over HTTPS with client certificate authentication

The tutorial, SOAP over HTTPS with client certificate authentication, will show you how we can use client certificate to handshake with server along with basic authentication for consuming the service. We have also seen how to authenticate by sending authentication information over http headers in SOAP web service but here we will use client certificate (jks file) as a security mechanism. Even you can use header authentication along with client certificate to make more secure.

I will show here both server side code or service and client side code so that server expects client to establish communication through certificate authentication. Here to consume the service you will be given client certificate (extention might be .crt or .der or .p12 or anything else), password for this certificate and username/password for basic authentication (in case if you need also header authentication).

Continue reading “SOAP over HTTPS with client certificate authentication”

SOAP over HTTPS with client certificate authentication was last modified: May 17th, 2018 by Soumitra Roy Sarkar

Validate Email Address with Regular Expression using Kotlin

This tutorial will show you how to validate email address with regular expression using Kotlin. 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 in Eclipse.

Please read here how to create Kotlin project in Eclipse.

Continue reading “Validate Email Address with Regular Expression using Kotlin”

Validate Email Address with Regular Expression using Kotlin was last modified: May 11th, 2018 by Soumitra Roy Sarkar

Integrate npm web app in Spring Boot with Gradle

Integrate npm web app in spring boot with gradle is basically a multi-module project as we have seen in our earlier tutorials here with maven build in spring boot and here with maven in Eclipse. But the example on integrate npm web app in spring boot with gradle uses gradle to build the project. Here we basically create two modules one is frontend or client side called web-app and another one is backend called java-app. Obviously as the name suggests web-app, so it will contain only client side technologies to build the application whereas java-app will contain only java technologies to build the application. You don’t need to install npm going to the web-app folder manually. Npm installation and build will be automatically taken care by gradle build script. This application will also create an executable jar file once gradle build is successfully finished.

Continue reading “Integrate npm web app in Spring Boot with Gradle”

Integrate npm web app in Spring Boot with Gradle was last modified: May 7th, 2018 by Soumitra Roy Sarkar

How to Remove Namespace from XML using XSLT

In this tutorial we will see how to remove namespace from XML using XSLT. As the title suggests we will use here XSLT to remove namespace from XML. Removing namespaces from an XML document is not recommended and is in essence comparable to removing namespaces from a programming framework or library. It may risk name clashes and lose the ability to differentiate between distinct elements. But if you need to absolutely remove for some reason then consider to remove namespace from XML using XSLT.

You would also like to read similar tutorial Transforming XML to HTML using XSLT

Continue reading “How to Remove Namespace from XML using XSLT”

How to Remove Namespace from XML using XSLT was last modified: May 3rd, 2018 by Soumitra Roy Sarkar

Transforming XML to HTML using XSLT

Here we will see the example on transforming XML to HTML using XSLT. We can also use Java code to transform XML to HTML but that would require a many LoC to finish the job but using XSLT it is quite easy to transform. XSLT stands for XSL Transformations. The Extensible Stylesheet Language (XSL) is a family of recommendations and styling language for defining XML document transformation and presentation. It consists of three parts:

XSL Transformations (XSLT) : a language for transforming XML;
The XML Path Language (XPath) : an expression language used by XSLT (and many other languages) to access or refer to parts of an XML document;
XSL Formatting Objects (XSL-FO) : an XML vocabulary for specifying formatting semantics.

Continue reading “Transforming XML to HTML using XSLT”

Transforming XML to HTML using XSLT was last modified: April 29th, 2018 by Soumitra Roy Sarkar

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 reading “HackerRank Solution: Valid Username Regular Expression using Kotlin”

HackerRank Solution: Valid Username Regular Expression using Kotlin was last modified: April 28th, 2018 by Soumitra Roy Sarkar

HackerRank Solution: Tag Content Extractor using Kotlin

This tutorial will shoe you how to solve HackerRank Tag Content Extractor. In a tag-based language like XML or HTML, contents are enclosed between a start tag and an end tag like <tag>contents</tag>. Note that the corresponding end tag starts with a /.

Given a string of text in a tag-based language, parse this text and retrieve the contents enclosed within sequences of well-organized tags meeting the following criterion:

The name of the start and end tags must be same. The HTML code <h1>Hello World</h2> is not valid, because the text starts with an h1 tag and ends with a non-matching h2 tag.

Tags can be nested, but content between nested tags is considered not valid. For example, in <h1><a>contents</a>invalid</h1>, contents is valid but invalid is not valid.

Continue reading “HackerRank Solution: Tag Content Extractor using Kotlin”

HackerRank Solution: Tag Content Extractor using Kotlin was last modified: April 27th, 2018 by Soumitra Roy Sarkar

How to do a SOAP Web Service call from Java class

This example will show you how to do a SOAP web service call from Java class. Normally you would use the web service library for invoking the SOAP service but in some cases this could be useful and quick. For example, you may have problems generating a client proxy with a web service library or if you only need some small specific parts of the response. It is just a SOAP call over HTTP, from a plain piece of Java code without using any Java library. In fact you can invoke SOAP service from any language being web service platform independent.

Now in order to consume the service or SOAP web service call from Java class, we must have the service deployed somewhere. So please read Spring SOAP WebService Producers using Gradle before consuming this SOAP service. We will create here client which will consume the service in the given link. If you want to use library to consume the service then you can read Spring SOAP WebService Consumers using Gradle

Continue reading “How to do a SOAP Web Service call from Java class”

How to do a SOAP Web Service call from Java class was last modified: April 25th, 2018 by Soumitra Roy Sarkar

HackerRank Solution: Subarray using Kotlin

This tutorial will show you how to solve HackerRank Subarray using Kotlin.

A subarray of an n-element array is an array composed from a contiguous block of the original array’s elements. For example, if array=[1,2,3], then the subarrays are [1], [2], [3], [1,2], [2,3], and [1,2,3]. Something like [1,3] would not be a subarray as it’s not a contiguous subsection of the original array.

Please go through first how to create Kotlin project in Eclipse

Continue reading “HackerRank Solution: Subarray using Kotlin”

HackerRank Solution: Subarray using Kotlin was last modified: April 23rd, 2018 by Soumitra Roy Sarkar