Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

and many more ....

javax.swing.JLayer Example: A new Swing Feature in Java 7

java-logo

This is a example for JLayer class in javax.swing package. JLayer is a new swing feature in Java 7. In this example, JLayer is used to decorate and validate the Text Field & Date Field in the User interface. This article is built into two steps. The first step has the following: Creation of Validator UI createValidatorUI method is invoked ...

Read More »

Powermock – Mockito Integration Example

mockito-logo

Most of the mocking frameworks in Java, including Mockito, cannot mock static methods or final classes. If we come across a situation where we need to test these components, we won’t be able to unless we re-factor the code and make them testable. For example: Making private methods packaged or protected Avoiding static methods But re-factoring at the cost of ...

Read More »

XPath ends-with example

java-logo

In this example we will learn how to use the ends-with function of XPath. We will start with the introduction of XPath – what it is and how to use it, then we will see the working model of ends-with function. Tools and technologies used in this example are Java 1.7, Maven, Intellij, Saxon. 1. Overview An XPath expression specifies a pattern ...

Read More »

XPath concat Example

java-logo

We studied about Xpath normalize-space() method in the previous example. In this example, we will study how the concat(String s1, String s2, String... s3) method works. The XPath-concat method works similar to the String#concat method. It joins two or more strings into a single string. The argument strings maybe two or more static strings and/or they may be two or ...

Read More »

Tomcat connection pool configuration example

apache-tomcat-logo

1. Introduction In this example we will discuss Apache Tomcat Servlet/JSP container’s connection pull configuration via JNDI (Java Naming and Directory Interface ) resources. The connection pool we will look at is javax.sql.DataSource, which is a JDBC API for getting a connection instance to a database. In this example we will discuss setting a global DataSource for MySQL database. javax.sql.DataSource ...

Read More »

Mockito Verify Example

mockito-logo

In this article, I am going to show you an example of Mockito Verify. To test the state, we use assert, likewise, to verify the test interactions, we use Mockito.verify. Below are my setup details: I am using Maven – the build tool Eclipse  as the IDE, version Luna 4.4.1. TestNG  is my testing framework, in case you are new to TestNG, please refer TestNG Maven Project ...

Read More »

java.io.Console: New Feature in Java 6

java-logo

System.console() method is used for getting a unique instance of the Class Java.io.Console. Console device is associated with current Java virtual machine running. It is assumed that underlying platform is started from interactive command line. If the virtual machine is started automatically by a background job or a service, it would not have a console. The methods on Console are ...

Read More »

JSF Components Listeners Example

enterprise-java-logo

In this example of JSF Components Listeners, we will discuss about various component listeners provided by Java Server Faces and show you different ways of using the listeners. In a web page when the user makes changes to the input component or performs an action on the UI component, the JSF fires an event. These events can be handled by application ...

Read More »

JavaFX TableView Example

java-logo

This is a JavaFX TableView example. This example displays a table view of books with book title and author information. The TableView class is defined in the javafx.scene.control package of JavaFX API. The example uses Java SE 7 and JavaFX 2.2. This article’s example is built in two steps. The first has the functions and features: Table row represents a ...

Read More »

Loading environment specific configurations and properties with Spring using Maven Profiles and Settings Example

spring-logo

In this example we shall show you how to load specific environment configurations and properties with Spring using Maven POM Profiles and XML Settings. Our previous example, shows how to load specific environment configurations and properties using Spring where these properties files are located inside the project resource folder. However, sometimes we have a sensitive authentication information like database user name, passwords, etc., and uploading ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close