Iterating over a List in Java

In this example, we will see five ways to iterate over a List in Java. Consider the following list :   1. “for” statement   2. “enhanced for” statement   3.”while” statement   4. “do-while” statement   5. “iterator” statement  

Struts2 Multiple Configuration Files

  In Struts 2, we can include multiple struts config files into a single file using the <include …/> element, This is useful when we have a project which is divided into different business domains (divide and conquer). In this example we will create…

Struts 1 eXtremeTable Example

  The eXtremeTable is a JSP tag library used to display data in an HTML table format. It supports the following features: – Pagination – Column sorting – Multi-column filtering – Exporting data to PDF, Excel, CSV … – .. In this tutorial, we will see…

Connect to remote database through SSH

  In this example, we will create a Java program to connect to a remote database server through an SSH tunnel. We consider that we have a MySQL database instance running on a remote server : sec.keylesson.com. In fact, we can’t access the instance…

Spring Security Authorize Tag Example

  In Spring Security, the authorize tag is used to secure resources inside the JSP pages, like buttons, labels, links,.. In this example, we will add an HTML link to a JSP page and we will use the authorize tag to…

Hibernate Many to Many Annotation

  In this example, we will see how to map many-to-many relationship in Hibernate using annotations. We will use the Hibernate Many to Many XML Mapping  example and adjust it to support annotations.

JSF2 Password Field Example

  In this example, we will see how to add a password field in a JSF page using the <h:inputSecret ../>  tag. Password field is similar to text field,  the difference is that the characters in the password field are masked (shown…