How to Escape JSON String in Java- Eclipse IDE Tips

While working or JSON parsing in Java application it's quite common to just copy paste a JSON String from some resources e.g. a RESTful web service and then use the Jackson library to parse the JSON. This is the quickest way to test and learn parsing JSON string in Java, but the main problem with this approach is that the JSON String also includes double quotes "" which is also used for enclosing String literals in Java. Since JSON String itself contains double quotes, when you just copy paste them in your IDE or Java source file, the didn't work as expected. If you remember, if your String contains double quotes then those need to be escaped when you are pasting them as String literals in your Java code.

Difference between Stable and Unstable Sorting Algorithm?

Recently in one on the interview, after some initial questions about sorting algorithms e.g. how do you write QuickSort or difference between QuickSort and MergeSort, the interviewer asked about do you understand the difference between stable and unstable sorting algorithm? This question was new to my reader, so he says, Sorry, never heard about that. The story ended there, and Interviewer moved on to next question but like many of us, my reader went on to find more about unanswered  questions and ultimately he asks me what is the meaning of a stable and unstable sorting algorithm? Some of you might be heard about it and many of you might not know about this distinction, I'll try to answer this question in this article.

Top 5 books to learn Agile and Scrum Methodologies - Best, Must Read

When I started my career, it was all waterfall model. You try, fail, and then with every version you get an improved version of a software. I pretty much used to this model of software development until I was introduced to Agile development methodologies in my next company. I was confused about Agile as some people say its Scrum and Sprint, other ways its XP and Kanban etc. The confusion lasted for a long time because I was afraid of asking questions (afraid of being perceived as dumb and someone who wastes time on meetings) and only getting information in bits and pieces and I wasn't good at searching books at that time. From that experience, I learned that, when you have confusion and want to learn more about a new technology, nothing is better than a book or online training courses to start with.

3 Best Spring Security Online Training Courses for Java Developers

The Spring Security is one of the leading open source, security framework which allows you to implement security in Java based web applications. It provides several security features e.g. authentication, authorization, remember me out-of-the-box, which means you can directly use them without adding code or changing your class. Yes, Spring Security implements security at application level i.e. you can even secure your non-secure resource without modifying them. It is also the leading framework to secure RESTful Web Services. Because of all these, the demand for Java developers with good knowledge of Spring Security is very high. They are also some of the highly paid Java developers. Many Java and Spring developer, particularly those who are involved in enterprise and Java web development are learning Spring Security.

Top 5 Java And Android Game Programming Books for Programmers

Many programmers and game developers  think that Java isn't the best language for game design, but you cannot ignore Java for game development. There is always some popular platform which allowed you to develop and sell games in Java e.g. J2ME in past and Android now. Ever since Android used Java as a programming language, the game development in Java has got a new lifeline and seems to be doing quite well. Even games like Minecraft also doing great on the Java platform. It's true that C++ is still the best language to develop games due to their high-performance and many top game development companies e.g. Sony, Nintendo, and Microsoft XBox they prefer C++ over Java when it comes to developing great games. But with the Introduction of Android and iOS has completely changed the game development industry.

Maven - 10 Things Java developer should know

The Apache Maven is an essential tool for Java developers. It makes their life easy by allowing them to create Java project faster by using a standard directory structure. It also helps them to download project dependency automatically. Not only that, Maven also download transitive dependencies which relieve Java developers from the big headache of keep check of different versions of dependent libraries. For example, if your application is dependent on Spring framework but Spring is dependent on Log4j then you also need to download the correct version of Log4j JAR files for Spring MVC framework, Maven does this automatically for you. Maven also allows you to build projects, upload artifacts to the central or local nexus repository and deploy the release in your various test environments automatically.

Difference between application/x-www-form-urlencoded and multipart/form-data in HTTP/HTML?

Recently in one of the Java web developer interview, one of my readers asked about the difference between x-www-form-url-encoded and multipart/form-data MIME types. In HTTP, there are two ways to send the HTML form data to the server either by using ContentType application/x-www-form-urlencoded or by using multipart/form-data. Even though both can be used to send both text and binary data to the server there is a subtle difference between them. In the case of x-www-form-urlencoded, the whole form data is sent as a long query string.

Jersey Web Service Hello World Example in Java

After Restlet, Jersey is another popular open source framework to create RESTful web services in Java. Jersey conforms JAX-RS specification and actually it is the reference implementation of JAX-RS (JSR 311)(http://jsr311.java.net/nonav/releases/1.1/index.html) specification. In the last article, we have seen the Restlet HelloWorld Example and today we'll see the Jersey HelloWorld Example. Typically, when a developer thinks of creating a RESTful web service using Java, they assume that using a Java EE application server is the only way to create this type of application. However, there are simpler, lightweight alternative methods for creating RESTful applications available using Java SE. This tutorial demonstrates one such alternative using the Grizzly Web server along with the Jersey REST framework. Grizzly's main use case is the web server component for the GlassFish application server.

How to compare two lists of values in Microsoft Excel - Java

If you are working in real world application then you may frequently face scenarios where you have to compare data e.g. you get two lists of values and you want to know which values are common between two lists, which values only exists in the first list and which values only exists in the second list. If the list contains just 5 to 10 values you can do it easily with your eyes but what is fun if a programmer doing the task manually. You should be able to leverage all the tools available to you to do this comparison reliably. One of such ubiquitous and omnipresent tool is Microsoft Excel which is much more powerful then you can think of. It's like your brain, most of us just use 5% of Excel and a good knowledge of Excel's little bit advanced functionality e.g. VLOOKUP can be very helpful while comparing the list of values and reconciling data between different worksheet.

How Spring MVC Framework works? How HTTP Request is processed?

One of the frequently asked Spring MVC Interview questions is about explaining the flow of web request i.e. how an HTTP request is processed from start to end. In other words, explaining the flow of request in Spring MVC. Since many of my readers ask this question time and again, I thought to summarize the flow of request processing in a short article. It all starts with the client, which sends a request to a specific URL. When that request hit the web container e.g. Tomcat it look into web.xml and find the Servlet or Filter which is mapped to that particular URL. It the delegate that Servlet or Filter to process the request. Since Spring MVC is built on top of Servlet, this is also the initial flow of request in any Spring MVC based Java web application.

How to prepare for Spring Framework Certifications?

Ever since Pivotal, the company behind Spring framework made the mandatory Spring training optional (see here), I have received many queries from experienced Java developers who are interested in doing Spring certifications. This move from Pivotal suddenly makes the Spring certification affordable for many experienced Java and Spring developers who were interested in Spring certification earlier but couldn't progress further due to expensive mandatory training. Since many of them are now preparing for Spring certifications e.g Spring Core or Spring via self-study they are increasingly looking for good resources to prepare for the exam. I have received a lot of questions on preparation, books, mock exams, exam structure, passing marks and useful resources.

How to get JAR files of Jackson Libary for JSON Processing

If you are using Jackson to parse a JSON String in Java first time and wondering where can you get the Jackson related JARs, or which JAR files are really need then you have come to the right place. It can be really confusing for a new user to set up or include Jackson library in their Java projects sometimes, especially, if you are not very familiar with the structure of Jackson projects, various JAR files and in particular Maven. Since Jackson is the most popular open source library for processing JSON responses e.g. generating Java objects from JSON received from RESTful Web services or generating JSON String from Plain Old Java Objects (POJO). It is the go-to library for any JSON need because it offers a lot of features without compromising on performance.

What is the cost of Spring Framework Certification and Training in India and USA?

One of the frequently asked question about Spring certifications and training e.g. Spring Core and Spring Web Application Developer Certification is their cost e.g. what is the cost of Spring certification in India? or how much it cost for Spring framework certification in the USA etc. Earlier, Spring certification used to cost around 3000 USD in the USA and other North American countries and around 50,000 INR in India due to mandatory training you needed to take before you can appear in the exam. The cost of the Spring framework training was more than 90% of the total cost of the Spring certification. But gone are those days. Since 10th May 2017, you can take the exam without mandatory training, see here. Due to this reason, the cost of Spring certification has come down heavily and it's just now the cost of the exam voucher which is just 200 USD globally.

2 Books to Prepare for Spring Professional Certifications Exam

Ever since Pivotal has removed the requirement of mandatory training to become a certified Spring developer, many Spring developers have been asking for good resources to prepare for Spring Professional V4.2 Exam and Spring Professional V4.3 Exams e.g. good books, mock exams, study notes etc. to prepare for Spring Core Certifications via self-study. Since, earlier, you cannot give Spring certification exam without attending an online or instructor-led core Spring training, which cost around 3200 USD in the USA and North America and 50K INR in India, many experienced Spring developers refrain from becoming a certified Spring developer. Now that restriction has been lifted and it's not mandatory to take training to take Spring certification, many Java developers who have good working experience in Spring framework are looking to get recognition for their skill.