Category: Java
Load File From Resources Folder Java
In this tutorial we will show you how to load a file from the resources folder in Java. There are some cases in which you want to get a file from the resources folder, in...
JSF 2.2 Table CRUD Ajax Example
In this tutorial we will show you how you can use Ajax in JSF 2.2 to manipulate table data using CRUD operations. With every operation we perform on our data we refresh only a part of our...
JSF 2.2 Basic Ajax Feature Example explained
Project Environment Java JDK 1.7 JSF 2.2.8-02 Servlet Spec. 3.1.0 Apache Tomcat 8.0.15 Maven 3.2.3 JSF 2.2 AJAX View We are explicitly including the JSF JavaScript library which is not necessary if you specify the...
Create ZIP File Using try with Resources in Java
Create the ZIP ZIP file generation in java is straight forward. You need a ZipOutputStream that takes a FileOutputStream witch takes the output name of the file. Using this with try with resources is...
Different Ways to Iterate over a Map in Java
Map<k, v> A Map has Set of key value pairs. One key refers to only one value as such a map cannot contain duplicate keys. package com.memorynotfound.collections.map; import java.util.HashMap; import java.util.Iterator; import java.util.Map; /** * @author MemoryNotFound.com...
Generate Random Number Inclusive and Exclusive in Java
Random numbers can be generated using the java.util.Random class or Math.random() static method. There is no need to reinvent the random integer generation when there is a useful API within the standard Java JDK....
Different Ways to Iterate over a Set in Java
Iterate over a Set A Set is a Collection that cares about uniqueness, it doesn’t allow duplicate elements. The .equals() method determines whether two objects are identical in witch case only one object can be...
JSF 2 Project Configuration and Dependencies
JavaServer Faces (JSF) is a Java specification for building component-based user interfaces for web applications. In this tutorial, we will show you how to develop and configure a JavaServer Faces example project. Some key...
Different ways to Iterate over an ArrayList in Java
ArrayList ArrayList is a collection that is ordered by index. This means that when you add elements to the ArrayList the order of the list is determined by insertion order. Lists are zero based this...