To add a locale to Jasperserver you need to open the applicationContext-security.xml file. This is located in the WEB-INF folder.
How to display project version in Java
Sometimes, it’s useful to display the project version in your application. That version can be found in the MANIFEST.MF file. It’s located in every JAR or WAR file in the META-INF folder.
How to use json with java
Is it possible to use json in combination with java? The answer is yes! You can easily parse json objects to java objects and vice-versa. To do so, you can use Google’s framework ‘gson’:
Maven dependency
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
</dependency>
How to skip maven unit test in Eclipse
When you want to build, install, clean… maven. You have to run all the unit tests. The problem is when you have plenty of tests or database connections to test, the time that the build need is way too long. It is possible to build without running the tests. You can configure that in Eclipse:
How to test a private constructor
You can test a private constructor by using Reflection. Insert the following code in your unit test class:
How to delete javadoc
To delete javadoc from your classes, you can use a regular expression:
/\*\*(?s:(?!\*/).)*\*/
How to fix Eclipse error ‘still running after platform shutdown’
If you can’t start Eclipse eand you get a pop-up that says you have to look in the .log file in the {your workspace}/.metadata folder, you have probably the following error:
Job found still running after platform shutdown.
Jobs should be canceled by the plugin that scheduled them during shutdown:
org.eclipse.ui.internal.AbstractWorkingSetManager$9
How to find the similarity rate of two objects
How can you find the similarity rate of two objects expressed by a percentage? Read it below.
For example, I have two objects with the same object type. In this example we have an object ‘contact’.
Free online tools for developers
On freeformatter.com/ you have many free online tools for developers. The tools contain converter, formatters, decryptors, validators and many more. It could be used for XML, HTML, SQL, JSON…
Online conversion between a java.util.Date and milliseconds
If you want to convert a Date to milliseconds or milliseconds to a Date in Java, there is a good website to do that: