How To Create Users In Tomcat Server

Introduction Here I am going to show you how to create users in Tomcat server to manage applications, server status, etc. When you deploy application into Tomcat server, generally you put the war archive files under webapps folder of the Tomcat server. You can easily access the application once it is successfully deployed through its context path of the application….

Write Or Append To A File Using Java

Introduction In this short example code I will show you how to create a new file for writing into it or if the file already exists then append to it instead of creating a new file using Java programming language. If you have a requirement that either you need to log some data into an existing file or create a…

PreAuthorize HasRole Security Using Spring Boot Data JPA

Spring Security Has Role PreAuthorize hasRole Spring security will determine whether a user can invoke a method or not based on his/her role. hasRole() method returns true if the current principal has the specified role. By default if the supplied role does not start with ROLE_ will be added. This can be customized by modifying the defaultRolePrefix on DefaultWebSecurityExpressionHandler. In…

Pretty Print JSON In Python

Table of Contents Introduction Why do you need to prettify the JSON data? Prerequisites Pretty Print JSON Source Code Introduction In this example I am going to show you how to pretty print JSON in Python programming language. The ugly JSON or one liner JSON data or string could be very difficult to read manually and that’s why you may…

Generate Single Jar Or War In Spring Boot App Using Gradle Build Tool

Table of Contents Introduction Wny do you need a single jar or war Prerequisites Generating Jar Generating Thin Jar Generating Fat Jar Generating War Generating Thin War Generating Fat War Source Code Introduction Generally most of the Spring Boot applications generate jar archive for deployment. Very few Spring Boot applications generate war archive for deployment in the production environments. There…

Spring Boot Thymeleaf jQuery MultiSteps Form

Table of Contents Introduction Prerequisites Project Setup MySQL Table DataSource Config Entity Class Repository Interface Service Class Spring Web Controller Spring Boot Main Class UI (User Interface) Testing Multi Steps Form Source Code Introduction In this example I am going to show you how to build multisteps form using Spring Boot thymeleaf jquery. Multi steps form is required when users…

Junit 5 Test Report Using SonarQube Jacoco Gradle

Table of Contents Introduction Prerequisites Project Setup The Junit 5 Test Class Generating Test Reports Scanning Project with Sonar Source Code Introduction In this Spring Boot based application I am going to show you how to generate Junit 5 test report using SonarQube Jacoco gradle build tool. You need to generate such test reports to ensure that your source code…

How To Create Photo Gallery In Angular

Table of Contents Introduction Prerequisites Project Setup Setup ngx-lightbox App Module Configuration Update Title App Component App HTML App Styles Testing Angular Photo Gallery Source Code Introduction In this example I am going to show you how to create photo gallery in Angular application. Photo gallery also known as image gallery or media gallery or photo album and it is…

CodeIgniter 4 REST API JWT Authentication

Table of Contents Introduction Prerequisites Project Directory MySQL Table Database Configuration Route Configuration Model Controller Library Testing CodeIgniter 4 REST JWT Source Code Introduction In this example I will show you how to use JWT (JSON Web Token) in CodeIgniter 4 REST API for authenticating/authorizing a user when he/she is trying to access REST API. A user must register in…

Detect Hidden Rows In Excel File Using Apache POI

Table of Contents Introduction Prerequisites Project Setup Detect Hidden Rows/Cells in Excel Java Code Testing Hidden Rows/Cells Source Code Introduction Here in this example I am going to show you how to detect hidden rows in excel file using Apache POI library with the help of Java program. The following data are used in the excel sheet. The first two…