-
script
Import package in script
In this example we shall show you how to import a package in script. We are using the ScriptEngine interface, that…
Read More » -
script
Invoke specific script function
This is an example of how to invoke a specific script function. We are using the ScriptEngine interface that provides methods…
Read More » -
decorator
Java EE 6 Decorators advanced usage
The example we’ll use is a Social media feed processor. So I have created an interface:  public interface SocialFeedProcessor…
Read More » -
strategy
Implement a shopping cart using the Strategy Pattern
First a definition: in the simplest terms, you can define the Strategy Pattern as telling an object to do a…
Read More » -
aspectj
Logging aspect example
Once upon time I was writing a plugin for a closed-source LMS J2EE application having such dependencies that it wasn’t…
Read More » -
BasicDatasource
Create a simple BasicDataSource object
With this example we are going to demonstrate how to create a simple org.apache.commons.dbcp.BasicDataSource object, that is the basic implementation…
Read More » -
net
Get list of files from FTP Server
In this example we shall show you how to get a list of files from an FTP Server. We are using…
Read More » -
net
Download file from FTP Server
This is an example of how to download a File from an FTP Server, using the org.apache.commons.net.ftp.FTPClient Class, that encapsulates…
Read More » -
lang3
Check if Days and Calendars match
With this example we are going to demonstrate how to check if Days and Calendars match. We are using the…
Read More » -
lang3
Generate random alphanumeric string
In this example we shall show you how to generate random alphanumeric String objects. We are using the org.apache.commons.lang3.RandomStringUtils class, that…
Read More »