Thursday, August 31, 2023

Top 10 XML Interview Questions and Answers for Beginners

XML Interview questions are very popular in various programming job interviews, including Java interviews for web developers. XML is a mature technology and is often used as a standard for transporting data from one platform to another. XML Interview questions contain questions from various XML technologies like XSLT which is used to transform XML files, XPATH, XQuery, and fundamentals of XML e.g. DTD or SchemaIn this article, we will see the top  10 frequently asked XML Interview questions and answers from the above topics. These questions are mostly asked in various Java interviews but they are equally useful in other programming interviews like C, C++, Scala, or any other programming language.

Tuesday, August 29, 2023

Udemy vs Pluralsight Review 2024? Which is better to Learn to Code and Programming?

Hello guys, how are you doing? I am again back with answering one of the familiar doubts among online learners, Pluralsight, or Udemy? Which are the better websites for learning code and leveling up your programming skills? As a Java blogger and editor of a Medium publication, I often receive questions like this from my readers. Earlier I have answered questions like Pluralsight vs. CodeCademy and Udemy vs. CodeCademy but never explained about Pluralsight vs. Udemy, which many of my readers have been asking for a long time. Since Pluralsight and Udemy are two of the most popular online learning platforms and I also spend considerable time every day on each of them, I felt to write my review of Udemy and Pluralsight and explain the pros and cons of both Udemy and Pluralsight so that you can make an informed decision when it comes to learning tech skills online.

Monday, August 28, 2023

What is CQRS Design Pattern in Microservices? With Examples

In a microservices architecture, it's common to have multiple services that need to interact with the same data store. However, traditional approaches to managing data, such as using a single database for all services, can lead to performance issues and data consistency problems. To address these issues, a design pattern called Command Query Responsibility Segregation (CQRS) has emerged as a popular approach to managing data in microservices. I have been sharing my knowledge about Microservices and Java from past few months and earlier we have covered 10 essential Microservice design patterns and principles and best Microservices courses for Java developers which many of you appreciated. At the same time, a lot of you asked me to go deep down into each of those patterns and explain them with examples.

How to upload/download files in Spring MVC Java web applications? Example Tutorial

Hello guys, if you are wondering how to upload file and download files from a Spring MVC application then you have come to the right place. This is an important functionality for any real-world application and knowing how to upload a file in a Spring application is important for professional Java developers and that's what you will learn in this Spring MVC tutorial. Earlier, I have shared several Spring Boot tutorial like Spring Boot + Microservices, and Spring Boot + REST and even  how to upload files using Servlet and JSP using Apache Commons FileUpload library and In this tutorial, we are going to discuss how to upload and download files using Spring MVC. 

Difference between Spring Boot and Spring Cloud Framework

Hello guys, if you are doing Java development and created Microservices then you may know that Spring Boot and Spring Cloud are two popular Java-based frameworks that are widely used for building enterprise-level applications, particularly Server side backend Java application. Both of these frameworks are developed by the Spring team and offer unique features that make them stand out in the market. While both are used for building scalable, high-performance, and robust Java applications, they serve different purposes and are used in different ways. The aim of this article is to help Java developers understand the differences between Spring Boot and Spring Cloud and make an informed decision on which framework to use for their next project.

How to create a Java Web application using Spring MVC Framework? Example Tutorial

Hello guys, if you are looking for an example to create a Spring MVC application then you have come to the right place. Earlier, I have shared the best courses to learn Spring MVC, Books, and interview questions and In this tutorial, we are going to explain how to create your first MVC application with the spring framework. At present, there are many applications in the world, and developing them is also varies according to the performance, type of the application, and many other factors. However, one of the primary languages used for application development is Java with the model-view-controller (MVC). Here comes the spring framework for application development and will go through an example project to explain this further.

Sunday, August 27, 2023

What is @Value Annotation in Spring? Example Tutorial and difference between $ and #

Hello guys if you want to learn about @Value Annotation in Spring Framework like how to use it or when to use it then you have come to the right place. Earlier, I have talked about @Value annotation when I shared 10 essential Spring Framework annotations and in this article, we are going to take an in-depth look at a Spring @Value annotation. We start our understanding with the term and then, move on to find the difference between $ and #. The @Value annotation is essential to the Spring Framework's ability to inject values into Spring beans from outside sources. Developers can externalize configuration with this annotation, which increases the flexibility and configurability of their work. 

Friday, August 25, 2023

Top 15 HTTP Protocol Interview Questions for Web Developers

Hello guys, as a web developer, understanding the HTTP (Hypertext Transfer Protocol) is vital for building robust, secure and efficient web applications. The HTTP leads the foundation of data communication on the World Wide Web (also known as WWW), allowing clients and servers to communicate and exchange information. That's why it's common to see questions related to HTTP and HTTPS like how HTTPS work? What is difference between HTTP  1, HTTP2, and HTTP3 and What is TLS and SSL Protocol etc are common questions during web developer interviews. In the past, I have shared Apache Web Server interview questions and  In this article, we will explore 15 important HTTP protocol interview questions, providing in-depth explanations and real-world examples to help web developers grasp the concepts better.

Thursday, August 24, 2023

10 Tips to work Faster in Linux Command Line and Bash Shell for IT Professionals

Hello guys, Have you ever been amazed to see someone working very fast in UNIX, firing commands, and doing things quickly? Yes, I have noticed that a couple of times, and I have always been inspired to learn from those superstar developers. I have shared a lot of content on Linux from the Developer's point of view, including 5 Free Linux Courses for Programmers, and in this article or tutorial or whatever you call it, I have dedicated myself to sharing some UNIX command practices I follow to work fast, quick, or efficiently in Linux. I work for the Financial services industry, and my work involves the development and support of online stock and futures trading applications in Electronic trading, Derivatives, etc. All our services run on Linux servers, so I need to work efficiently and quickly on the Linux machine, and that's how I have learned these productivity tips in Linux.

Wednesday, August 23, 2023

How to implement API Gateway in Microservices with Spring Cloud Gateway? Example Tutorial

Hello guys, if you are learning Microservice architecture then you must have come across a term called API Gateway. It's like the Frontcontroller pattern we used to learn 10 years ago. It is one of the crucial component of your Microservice architecture as you can hide all your service behind this and let all the API request goes through this component. That's the reason it also called API Gateway. By single handling all request and routing through different services it solve the problem of client to remember all host and port details of multiple services.  Now they only need to know about API Gateway which is much more manageable. In my last few articles , I have explained SAGA PatternCQRS Pattern, and Database Per Microservice pattern and in this article, we will see how we can use Spring Cloud Gateway to create API Gateway in a Microservice architecture. 

Monday, August 21, 2023

Difference between @SpringBootTest vs @WebMVCTest in Spring Boot

Hello and welcome to yet another blog post. In this article, we are going to take a look at the difference between the two annotations i.e. @SpringBootTest and @WebMVCTest. When developing a Spring Boot application, you may have come across two annotations that are commonly used for testing - @SpringBootTest and @WebMvcTest. Both of these annotations provide ways to test your application, but they differ in their scope and purpose. In the past, I have shared difference between @WebMVCTest and @DataJpaTest and in this article, I Am going to explain the difference between @SpringBootTest and @WebMvcTest in Spring Boot. It's also one of the common Spring Boot testing question and I have also included in my list of popular Spring Boot Testing Questions Earlier, Anyway, before seeing the difference between these two, Let's first look at a quick overview of the @SpringBootTest and @WebMvcTest annotations before figuring out how they differ from one another. 

Sunday, August 20, 2023

Top 30 Eclipse Keyboard Shortcuts for Java Programmers [UPDATED]

Hello guys, if you use Eclipse for Java development and looking to increase your productivity then you have come to the right place. Earlier, I have shared the 5 best Eclipse courses and in this tutorial, I will share 30 Eclipse keyboard shortcuts to improve your productivity. This list is by no means complete, and I will suggest you guys share eclipse shortcuts listed other than here to make this more useful. Eclipse is the most used Java development IDE, and knowing these Eclipse shortcuts not only improves your productivity but also makes you more efficient. You will have more time for things you like to do. Using keyboard shortcuts also helps to impress colleagues and shows that you have a good hold on tools you used for Java Development.

Thursday, August 17, 2023

JDBC Database Connection Pool in Spring Framework – How to Setup Example

Setting up JDBC Database Connection Pool in Spring framework is easy for any Java application, just matter of changing a few configurations in the spring configuration file. If you are writing core java application and not running on any web or application server like Tomcat or  Weblogic,  Managing Database connection pool using Apache Commons DBCP and Commons Pool along-with Spring framework is a nice choice but if you have the luxury of having web server and managed J2EE Container, consider using Connection pool managed by J2EE server those are a better option in terms of maintenance, flexibility and also help to prevent java.lang.OutofMemroyError: PermGen Space in tomcat by avoiding loading of JDBC driver in web-app class-loader.

How to call Stored Procedures from Java using IN and OUT parameter - Spring Framework Example Tutorial

Spring Framework provides excellent support to call stored procedures from Java application. In fact, there are multiple ways to call stored procedures in Spring Framework, e.g. you can use one of the query() method from JdbcTemplate to call stored procedures, or you can extend abstract class StoredProcedure to call stored procedures from Java. In this Java Spring tutorial, we will see the second approach to call a stored procedure. It's more object-oriented, but at the same time requires more coding. StoredProcedure class allows you to declare IN and OUT parameters and call stored procedure using it's various execute() method, which has protected access and can only be called from a subclass.

How to write Thread-Safe Code in Java

thread-safety or thread-safe code in Java refers to code which can safely be used or shared in concurrent or multi-threading environment and they will behave as expected. any code, class, or object which can behave differently from its contract on the concurrent environment is not thread-safe. thread-safety is one of the risks introduced by using threads in Java and I have seen java programmers and developers struggling to write thread-safe code or just understanding what is thread-safe code and what is not?

Sunday, August 13, 2023

Mortgage Calculator in Java: A Step-by-Step Guide with Code and Example

Hello guys, its been long time since I shared a Java programming exercise so today I am going to share a popular one, how to create a Mortgage calculator in Java. A mortgage calculator is a powerful tool that allows individuals to estimate their monthly mortgage payments based on factors such as loan amount, interest rate, and loan term. So, its not just a Java programming exercise but a useful tool to calculate mortgage payment for your home loan, car loan or business loans. In the past, I have shared top 50 Java programs from coding interviews as well as 10 Java programming exercises and In this article, we'll walk you through the process of creating a simple mortgage calculator using Java. We'll cover the necessary concepts and provide you with a complete Java code example to help you get started.

Difference between RestTemplate and WebClient in Spring Boot? Example

Welcome to the blog post. Today we are going to take an in-depth look at the difference between two of the Spring framework’s web client implementations i.e. RestTemplate and WebClient. As usual before moving to the topic, let us give you a thorough understanding of the two Libraries so, without further ado let’s jump into the topic.  RestTemplate and WebClient are both popular libraries provided by the Spring Framework for making HTTP requests to external APIs. While they both serve the same purpose, they have some fundamental differences that make them suitable for different use cases. In this article, we will explore the differences between RestTemplate and WebClient, with the help of examples.

Friday, August 11, 2023

6 Ways to Change Default Port in Spring Boot? Example Tutorial

Hello Java programmers, when developing a Spring Boot application, we often need to configure the port on which our Spring Boot application runs as the default port most likely already occupied. The default port for a Spring Boot application is 8080, but in certain scenarios, you may want to change it to a different port number as its too common and you may find that some other application is using it already. In this article, we'll explore different methods to configure the port for a Spring Boot application, allowing you to customize the port according to your requirements. You can use any of them to configure the port you want for your Spring Boot application.

How to Secure Password in Java using Spring Security? Password hashing and Salting Example Tutorial

Hello guys, if you are wondering whether Spring Security provides password hashing or not and wondering how to use it in your project then you have come to the right place. First, Yes, Spring Security provides out-of-the-box support for password hashing and salting, but before going into the details of how to use that, let's first understand what is password hashing and salting and why do you need that in a secure web application. One of the common requirement of a secure application is that password is never stored in the plain text. It doesn't matter if you are storing password in a database or a flat file they must be stored in encrypted form. The process to encrypt password for storing is known as hashing

Wednesday, August 9, 2023

How Spring Security works? What is role of DelegatingFilterProxy and springSecurityFilterChain?

Spring Security is a very straight-forward framework. It protects your application by locking URLs. It provides both authentication and authorization facility for Java web application, but the big question is how does it do that? How exactly Spring Security works internally? I have seen this Spring Security question coming up several times on recent Spring interviews, so I thought to summarize what I know about working of Spring Security. The most important thing to remember is that Spring security works by using servlet filters. Since, an HTTP request is first passed to a matching filter before passing it to servlet, you can use a filter intercept an HTTP request and that's what Spring security does it. 

Difference between @Component @Bean and @Profile in Spring Framework

Hello guys, if you are thinking what is difference between @Component, @Bean, and @Profile annotation in Spring then you have come to the right place. Earlier, I have shared  difference between @Component, @Service, @Reposistory and @Controller annotations and in this article, I am going to answer another popular Spring interview question about difference between Component, Bean and Profile annotation. If you are working in Java then you may know that Spring is a popular Java framework that provides a variety of tools and features for developing robust and scalable applications. In Spring, you can use annotations to simplify the configuration of your application and to manage dependencies between components. @Bean@Component, and @Profile are three commonly used annotations in Spring that serve different purposes.