Preparing for Java Interview?

My books Grokking the Java Interview and Grokking the Spring Boot Interview can help

Download PDF

Friday, April 12, 2024

Top 7 Spring and Hibernate Training Courses for Java JEE Programmers in 2024 - Best of Lot

Spring and Hibernate are two of the hottest and most in-demand web frameworks in the Java world and also two of the most essential skill for any Java programmer to get a job in the web development space. The Spring framework is in around 2004 and established itself as the leading framework to develop Java applications both in core Java and web development areas. The Spring framework comes with a lot of modules to support different kinds of developments like Spring Security to address the security requirements of most web and enterprise Java applications. It supports single sign-on, LDAP authentication, Role-based access control, and much more such essential features. Spring also supports the development of REST services which is now become a standard way to provide web services.

Thursday, April 11, 2024

10 Examples of @RequestMapping Annotation in Spring MVC and REST

The @RequestMapping annotation is one of the most important annotation of Spring MVC which provides mapping of HTTP requests to controller methods, I mean Java methods on Controller class for processing. If you wonder, how Spring handles a particular request and which method from controller class is called for a particular request, answer lies on @RequestMapping annotation. This annotation maps web request to methods on controller class. You can apply @RequestMapping on class or method level of your controller. This is a powerful annotation and give you a lot of option to sophistically map a web request e.g. you can narrow down mapping by using HTTP headers, HTTP methods e.g. PUT or POST, and by using Query parameters.

Top 10 Java Programming Courses for Beginners to Learn Online in 2024 - Best of Lot

If you are a computer science graduate or someone who wants to learn Java and looking for some awesome resources like books, tutorials, and online courses then you have come to the right place. In the past, I have shared some great books, websites, and tutorials to learn Java and in this article, I am going to share some of the best Java courses beginners can join to learn Java in 2024. One of the main problems with learning Java is keeping pace with the increasing number of releases. For example, Java 8 release completely changed how Java is written and after that, we have many Java releases in the form of Java 9Java 10, Java 11, 12, 13, 14, 15, 16, and now Java 17. But the good thing is that the core of Java is still the same and all its releases are backward compatible.

Top 5 Courses to learn Microsoft Azure Cloud in 2024 - Best of Lot

Hello guys, if you want to learn about the Microsoft Azure Cloud Platform, you have come to the right place. In the past, I have shared the best courses to pass Azure FundamentalsAzure Administrator, and Azure Architect certifications. Today, I will share the best online course to learn the Azure platform for Beginners. These are top-quality courses from expert trainers and instructors and are picked from Udemy, Coursera, and edX. You can use these courses to learn Microsoft Azure core services and prepare for different Microsoft Azure certifications like AZ-900, AZ-303, and AZ-20 Azure developer associate certification.

Top 3 Books to Learn Java for C and C++ Programmer?

In the last 2 decades, many Java programmers started programming with C and C++, but the situation is changed now, you have more choices like you can choose Python, or you can even start with Java. It seems Academia prefers Python in the USA and Java in India, but there are still many programmers who know C and C++ and want to learn Java for one or other reasons. I often receive emails from my readers about book recommendation, and recently, a couple of them asked me to suggest the best Java books for C and C++ programmers. I can relate those beginners to myself because I have also gone through the same phase, but those days, the university textbooks are our only source to learn new things. We didn't have broadband, and unlimited access to the Internet and eBooks was not popular at that time, but things have changed.

Wednesday, April 10, 2024

How to limit Concurrent Login Sessions in a Java web application using Spring Security? Example

If you don't know, Spring security can limit the number of sessions a user can have in a Java web application. If you are developing a web application especially a secure web application in Java JEE then you must have come up with the requirement similar to many online banking portals have like only one session per user at a time or no concurrent session per user. If the user tries to open a new session then either an alert is shown or his previous session is closed. Even though you can also implement this functionality without using spring security but with Spring security, it's just a piece of cake with coffee :). 

2 Ways to setup LDAP Active Directory Authentication in Java - Spring Security Example Tutorial

The LDAP authentication is one of the most popular authentication mechanism around the world for enterprise application and Active directory (an LDAP implementation by Microsoft for Windows) is another widely used LDAP server. In many projects, we need to authenticate against active directory using LDAP by credentials provided in the login screen. Sometimes this simple task gets tricky because of various issues faced during implementation and integration and no standard way of doing LDAP authentication in a Java web application. Even though Java provides LDAP support but in this article, I will mostly talk about spring security because of it's my preferred Java framework for authentication, authorization, and security-related stuff.

Entuware or Whizlabs? Which Exam Simulator Should you Buy for Java Certifications (OCAJP, OCPJP, and Others)?

I often receive queries from Java certification aspirants about exam simulators like whether should I go for Whizlabs or Enthuware, which one is better? If I have to buy just one exam simulator, which one would you recommend, Whizlabs or Enthuware? I thought to answer all those questions in a blog post and here you go. To be honest with you both of them are really high-quality test simulators and whichever you buy, you will do well on actual exams. But, as a programmer, I really like to analyze the situation, I compare pros and cons of each of them before I buy one of them. Since I have used both of them in the past I am sure about that in quality, they are neck to neck there, but here are couple of things which you can consider before buying Java certification simulator from Whizlabs or Enthuware?

Monday, April 8, 2024

How HTTP Basic Authentication works in Spring Security? Explained

In the last article, I have taught you how to enable Http basic authentication in Spring security-based Java application, and now we'll go one step further to understand how exactly http basic authentication works in Spring security. If you remember, when you use HTTP Basic for authentication purposes, the client, like a browser or a rest client sends login credentials in the http request header. The header is aptly named "Authorization," and it contains a Base64 encoded string, which is created by concatenating username and password using a colon. For example, if the username is "johnsmith" and the password is "JOHN3214" then they will be concatenated as "johnsmith:JOHN3214" before encoded using base 64 encoding algorithms.

Top 5 Software Development and Project Management Books - Best of Lot, Must Read

Hello guys, if you are looking for Software development and Project management books then you have come to the right place. Earlier, I have shared Software development and project management courses and today I am going to share best books you can read on Software development and project management. You may be wondering, Why software development project managers should read books? Isn't they are experienced enough to become a project manager and handle software development and manage Programmers? A genuine question, but Software management is harder than any other management purely because every Software or Project is different than the previous one. Many other streams of engineering, like Civil or Mechanical, got better in terms of estimation and management with the help of software, but software development is still run on experience.

How to send HTTP request using curl and wget command from Linux and UNIX? Example Tutorial

You can use either curl or wget command to send HTTP requests from UNIX or Linux operating system. Both commands allow you to send GET and POST requests, which means you can also call REST web services.  I have a Java web application, which runs on Linux and exposes WebServices. I was writing a UNIX script to download In some data from that web service when I hit by the question, how do I make an HTTP call from UNIX? What is the UNIX command should I use? If you are also facing the same problem, then you have come to the right ht place. Basically, you can use two UNIX commands to make the HTTP request, wget, and curl.

How to Prepare for Java 8 Certifications - Oracle Java SE 8 Programmer 1 (1Z0-808) and II (1Z0-809)

Today one of my readers asked about what is the latest OCPJP or Oracle Java exams available and is there a Java certification available for Java SE 19 and Java SE 17?. This prompted me to browse through Oracle's certification website. During my casual browsing, I noticed that even though it's almost a year since Java SE 9 was released and 6 months since Java SE 20was released the latest Java certification is still the Java SE 17 certification. I know, you might be thinking about Java SE 11 certification, which is the latest Java certification available, but still many programmers are going for Java 8 because that's what they use in their production environment. 

How to Fix Exception in thread "main" java.util.ConcurrentModificationException in Java? [Solved]

Hello guys, if you are struggling to solve Exception in thread "main" java.util.ConcurrentModificationException" error in Java and wondering why this error comes even if you are not using multiple threads then you have come to the right place. In this tutorial, I will tell you everything about this error like why it comes and how you can solve it. One of the common problems while removing elements from an ArrayList in Java is the ConcurrentModificationException. If you use classical for loop with the index or enhanced for loop and try to remove an element from the ArrayList using remove() method, you will get the ConcurrentModificationException but if you use Iterator's remove method or ListIterator's remove() method, then you won't get this error and be able to remove the element. 

How to fix java.lang.numberformatexception for input string null - Cause and Solution

The java.lang.NumberFormatException comes when you try to parse a non-numeric String to a Number like Short, Integer, Float, Double etc. For example, if you try to convert . "null" to an integer then you will get the NumberFormatException. The error "Exception in thread "main" java.lang.NumberFormatException: For input string: "null" is specifically saying that the String you receive for parsing is not numeric and it's true, "null" is not numeric. Many Java methods which convert String to numeric type like Integer.parseInt() which is used to convert String to int, Double.parseDoble() which convert String to double, and Long.parseLong() which convert String to long throws NumberFormatException to inform that the input String is not numeric.

How to fix java.net.SocketException: Software caused connection abort: recv failed

Out of many client servers related socket errors here is one more interesting socket related error from the Java program, "java.net.SocketException: Software caused connection abort: recv failed". The key point in this error message is "abort" and "recv", which means is someone (client or server) is trying to read from a closed connection. This error usually comes at the client socket end, when the server closed the connection before the client has read the response, but, in general, it can come to an end of the TCP socket, so you must check the log files for both clients and server to find out who is complaining. If the Server is complaining then it's fine and the client has closed the TCP connection may be due to timeout or any RuntimeException at the client end.