Monday, July 29, 2019

Why become a Certified Java Programmer? Does Oracle Certified Professional Earn more?

I have seen many Java programmers in doubt whether to go for Java certifications or not? Whether getting Java certified will help them to earn a better salary? or after becoming Java certified from Oracle will help them to get a Job. In this article, we will see what the benefits of getting Java certified are. I know higher income, better job prospects, and a better chance of promotion is at the top of the benefits of becoming a certified Java professional, but this certification provides much more value than that. Apart from all those tangible benefits, the most important thing is that you learn Java better, which help you everywhere like in your day job as well as on interviews.

Friday, July 26, 2019

How to limit number of concurrent session in a Java web application using Spring Security?

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 :). 

Tuesday, July 23, 2019

3 Ways to convert String to Boolean in Java? Examples

You can convert a String object to Boolean object or boolean primitive by using the Boolean.valueOf() and Boolean.parseBoolean() method. The steps are similar rot converting to String to other data types e.g. String to Integer and String to Long. You can use the valueOf() method to convert String to Boolean object and parseBoolean() method to convert given string to a boolean primitive value. Internally, valueOf() also uses parseBoolean() for parsing String but on top of that it also provides caching e.g. it can return Boolean.TRUE and Boolean.FALSE cached value for "true" and "false" string. 

Sunday, July 21, 2019

How to fix invalid target release: 1.7, 1.8, 1.9, or 1.10 Error in Maven Build

If you are building your Java project using Maven, maybe in Eclipse or from the command prompt by running mvn install and your build is failing with an error like "invalid target release: 1.7" or "invalid target release: 1.8" then you have come to the right place. In this article, I'll show you the reason why this error occurs and how you can deal with these errors even with higher Java version like Java 9, 10 installed on your machine, or maybe with Java 11 in the coming month. The root cause of the problem is that you have specified a higher Java version in your pom.xml file for Maven compiler plugin then what Maven knows in your system, and that's why it's saying invalid target release.

Thursday, July 18, 2019

Top 10 Java 11 Certification Mock Tests and Practice Questions | (4 Free OCAJP 11 - 1Z0-815 and OCAPJP 816 Sample Questions)

The latest Java certification is now out, the Java 11 Certification. Ever since Java 9 and Java10 were out, programmers were speculating that what will happen to Java certification now? Will there is, be a new Java 9 certification or Java 10 certification? Will there be a new Java certification every 6 months, following the Java SE release cycle? Well, Thankfully, nothing of that sort happened; a new Java certification every six months would have been a crazy idea, not just for students and programmers but also to all the party involved, including Oracle itself.  Now the big question is what has been changed in Java 11 certification, and should you go for OCAJP 8 or OCAJP 11 certification?

Sunday, July 14, 2019

Amazon Prime Day - Best Tech Deals - What Programmers and Tech People Can Buy?

Many of my friends and colleagues used to wait until November to buy books, gadgets, and other computer items to get the huge discount offered on Black Friday and Cyber Monday deals, but you don't need to wait that long. Amazon is bringing Black Friday to the summer with its annual Prime Day offers. The Amazon Prime day is nothing but a one-day (precisely one and half-day and this time full two-day) shopping extravaganza, where you will get huge discounts on thousands of Amazon products including books, games, gadgets, and other computer and electronics items. So, if you are looking to buy a new laptop, a new smartphone, or some fitness gadgets and watch then this is an awesome opportunity. 

Saturday, July 13, 2019

Bucket Sort in Java with Example - How Algorithm Works

In recent years, one of the questions I have increasingly seen in programming job interviews is about constant time sorting algorithms like do you know any O(n) sorting algorithm? how do they work? When I first encountered this question, I had no idea whether we can sort in constant time because even some of the fastest sorting algorithms like QuickSort or MergeSort takes O(N log N) time for sorting on their average case. After some research, mainly by going through the classic CLRS book and this DS and Algorithms course by Tim Buchalka and Goran Lochert on Udemy, I come to know that there indeed are some constant time or linear time sorting algorithms like bucket sort, counting sort, and radix sort, which can sort an array in O(n) time but they work with only a special set of input.

Friday, July 12, 2019

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.

Thursday, July 11, 2019

How to enable HTTP Basic Authentication in Spring Security using Java and XML Config

In the last article, I have shown you how to enable Spring security in Java application and today we'll talk about how to enable Basic HTTP authentication in your Java web application using Spring Security. I'll show you how to do that using both the Java configuration and XML configuration if you are using Spring Security 3.1 or lower version, but before that let's understand what is Http basic authentication and why do you need that? One of the most common ways to authenticate a user in a web application is by using form login like you provide a login page and user will enter his username and password for authentication. This works great for human users but sometimes there are situations where you can't use a login form for authentication.

Tuesday, July 2, 2019

Spring Framework Certification (VMware EDU-1202) FAQ - Frequently asked Questions Answers for Java Developers

If you are a Java developer, working in Spring framework and thinking to become a certified Spring professional but couldn't do it in the past due to expensive mandatory training provided by Pivotal and its partners then there is good news for you. From 10th May 2017, Pivotal made the Spring Core training optional for appearing to the Spring certification exam, which means, now, it's not mandatory to take Spring training for Spring certifications (see here). Similar to Oracle's Java certifications, you can become a Pivotal Certified Spring Professional by just buying the exam vouchers and scheduling your exam online using examlocal.com from anywhere in the world.

Monday, July 1, 2019

How Spring MVC Makes Easy to Create RESTful Web Services in Java

REST has now become a standard way to develop web services and when it comes to Java, there are many frameworks and libraries available e.g. JAX-RS, Restlet, Jersey, RESTEasy, Apache CFX etc, but I encourage Java developers to use Spring framework to develop RESTful web services. But, some of you might ask, why use Spring Framework to develop RESTful web services in Java? What is the advantage and why it's better than other frameworks and libraries available out there? Well, the most important reason I think to use Spring for developing RESTful web service is that you can use your Spring MVC experience to develop RESTful web services.