How to use regular expression in Java?

Regular expressions are very important tool for seraching in text. Below is the code snippet for executing regex search and capturing different parts of the string based on the regular expression The groups are captured by using (). In the regular expression above ([0-9]+)([_])(.*)([\.])([A-Za-z]+) the first group is defined as a number with at least … Read more

Using Websocket with Spring Framework and Vuejs

Websockets are full duplex (persistent) connections between client and server such that both can share information with each other without the need for repeatedly establishing a new connection. This removes the need for repeated polling from the client to get updates from the server. Not all browsers support Websockets and hence we make use of … Read more

Advanced profile management in Spring Boot

We all are aware of profile management in Spring Boot and the flexibility it provides in configuring our applications for different environments. The other powerful aspect of this is that at any given time we can have multiple active profiles. The advantage this gives is that we can mix the deployment environment profile along with … Read more

JDK 14 – JEP 361 Switch Expressions out from preview

In my previous post, I wrote about switch expressions and related enhancements released as a preview feature for JDK 12. Subsequently, in JDK 13 there were some changes proposed, like using yield keyword to return value from the switch block and released in preview. In the upcoming JDK 14 release, which will go GA in … Read more

JEP 355 Text Blocks in JDK 13

JDK 13 went GA on September 17th, 2019 and the prominent new features are listed here. One of the new features is “text blocks”. This allows writing multiline strings easily without the need for concatenation while splitting into different lines. Lets quickly look at the different ways of creating multiline strings: String aBlock = “”” … Read more

Integrating Amazon Cognito With Single Page Application (Vue.js)

Update:  I have reviewed this post based on the comments and I have fixed ambiguity in the same. Please refer to the sample code and remember to replace the values in the `.env.local` ( file with those which are available in your user pool and app client settings.  In this article, we will look at … Read more

Integrate Spring Boot Application with Amazon Cognito

In this article, we will show how to use Amazon Cognito service for authentication users in a Spring Boot application using the OAuth 2.0 client library introduced in Spring Security 5.0. What is AWS Cognito? Amazon Cognito is service offered by AWS which provides user management services like sign up and sign in, in addition … Read more

How to Create QRCode Using QRGen in Java

In one of my previous articles, we saw how to create QRCode and its SVG equivalent using Zxing Java library. The Zxing library is no longer actively maintained and for this, there is a wrapper around Zxing library called QRGen, which provides much higher level APIs and a builder syntax for generating QR Codes. In … Read more

JDK 12 – JEP 325 Switch Expressions

JDK 12 went GA on March 19, 2019, keeping its word on shorter release cycles and frequent releases. The features part of the release can be found here. One of the interesting features for the developers is the “JEP 325 Switch Expressions” which is available as a preview feature. A preview feature as defined here … Read more

%d bloggers like this: