A palindrome is a word, phrase, number, or other sequence of units that may be read the same way in either direction, generally if used comma, separators or other word dividers are ignored. [Not mandatory] Similarly, palindrome numbers are those numbers which represent same number if all digits are reversed (Underscores can be ignored in […]
A thread dump is a list of all the Java threads that are currently active in a Java Virtual Machine (JVM). There are several ways to take thread dumps from a JVM. It is highly recommended to take more than 1 thread dump while analyzing any problem such as deadlock or resource usage analysis. It […]
In this tutorial, learn to read or parse XML document using Java SAX parser API for XML example. Learn to parse XML elements to java objects.
Exception handling is very essential feature of any java program. Every good open source framework allows to write the exception handlers in such a way that you can separate then from your application code. Well, Spring 3 also allows you to do so using annotation @ExceptionHandler. Lets see how all this works. For demonstration, I […]
J2ME programmers count bytes the way a super-model counts calories. – Unknown Java: write once, run away! –Brucee If Java had true garbage collection, most programs would delete themselves upon execution. – Robert Sewell Saying that Java is good because it works on all platforms is like saying anal sex is good because it works […]
In this java example, learn to parse xml file and read attribute value with xpath. This example uses SAX parser to parse the XML file.
All of us have come among situations when we have to parse user input for validation. Other fields such as text or numeric are rather easy, but date date validation is little bit difficult and a small error can leave the application in unstable state. Usually, SimpleDateFormat‘s parse() method is used for validation. If parse() […]
Interceptors, as we know, are special web programming constructs which gets invoked everytime when a certain pre-configured web request is made. They are always the most important and basic functional segments designed very early in product life cycle, due to their importance. Download source code In this post, I am writing about using these interceptors […]
Since spring 2, you were writing your bean configurations to xml files. But, Spring 3 gave the freedom to move bean definitions out of xml files. Now, you can give bean definitions in your java files itself. This is called JavaConfig feature (using @Configuration annotation). In this post, we will see a example of this […]
You have learned that how to write the RESTful web services and also how to write Spring 3 web application. Now, its time to combine them so that your spring web application shall work like RESTful webservices also. Download source code For writing this application, I am modifying the source code written in previous post. […]