Maven basic examples in Eclipse

Here are three examples covering maven basics in Eclipse such as: convert a java project to maven nature, create a project with an archetype selection, and refresh/update projects and understand files and structure. For the article, I use eclipse-jee-2019-06, which already provides maven support. If you use a different version Read more…

Java 8 streams

Notes on practical usage of Java 8 stream filtering. Stream Filtering A Stream<T> references a sequence of T values, and exposes a set of aggregate operations we can use to manipulate data in a pipeline. As an example, we can find the name of any people older than 20. In java, you can loop Read more…

Parsing XML with Java

Here are some notes on parsing XML file with java to extract information Simple Example Assume we have an XML file and we want to extract specific attributes. A sample file could be: With XMLStreamReder Here is the code to quickly scan the XML file and get the values for Read more…

Passwords and Hashing

This page presents a few examples of using Java for passwords and hashing. Generate Password A Java example to generate a random password containing only alphanumeric characters. Java Code to ComputeSHA-512 digest other.. linux get sha-512/

Java Generics

Generics Generics were introduced in java 5 to add stability to the code. You can add type variables to classes, interfaces and methods. Generic Class Declaration Below you see an example of generic class declaration. by writing class Box<T>, you introduce the type parameter T, that can be used anywhere in the class. Read more…

Java XML processing with dom4j

XML DOM Parsing XPath Navigation Use XPath expression to navigate the document tree. Processing a single node To process multiple results, we need to use a List Document Creation You can create a docuemnt from scratch by using the DocumentHelper#createDocuemnt(). Adding nodes and attributes is easy and intuitive. Writing document to Read more…

ANT Intro

ANT (Another Neat Tool) ANT is a tool for automating software build processes, implemented in Java, and best suited to build Java projects. Ant uses an XML file to describe the build process and its dependencies. Ant is an Apache project, it is open source software, released under the Apache Read more…

JSP with JSTL

JSP and JSTL The JSP Standard Taglibrary (JSTL) is a set of libraries providing dynamic tags helping to perform common JSP operations, such as store/display data, perform iterations, manupulate XML, perform I/O, etc. In this post we see a few simple examples on how to use JSTL core taglibs. JSTL Read more…