On Java Development

All things related to Java development, from the perspective of a caveman.

Archive for the ‘Base Project’ Category

Using Java Reflection to call methods of a Java Class

without comments

Introduction

This post shows how to use Java Reflection to call getter methods of a Spring context bean (a POJO). The POJO contains the application’s property values and the values need to be logged to the application’s log-file during the application’s startup phase. Since the property name/value pairs differ across projects this means the bean’s method names for each property are also different since their names reflect the names of the properties. Traditional approaches to logging the property values means writing customized code to explicitly call each method by name. Adding to this, whenever a new property is added, the logic has to be modified to include a call to the new method.
Read the rest of this entry »

Written by admin

March 7th, 2014 at 6:03 am

Overriding RichFaces CSS values

without comments

Introduction

This post shows how to override RichFaces’ CSS values for a given component.
Read the rest of this entry »

Written by admin

February 20th, 2014 at 10:11 am

Facelets Templating

without comments

Introduction

This post is about Facelet templates that are used to define page composition. Templates makes it possible to reuse page segments such as the page’s banner or header. When used throughout the web application’s pages, Facelets simplifies the task of page design, provides the means to apply changes in a single place that can propagate across all pages and helps to ensure a consistent layout from page-to-page.
Read the rest of this entry »

Written by admin

February 1st, 2014 at 10:25 am

Web App Deploy Check List

without comments

Introduction

This short post presents the items to check before creating that .war-file and deploying to the server. If your project is based upon baseproject or is a Maven-based project and using JSF then these steps will ensure surprises are kept to a minimum.
Read the rest of this entry »

Written by admin

January 30th, 2014 at 2:56 pm

JSF Resources

without comments

Introduction

Since the release of JSF 2.0 in July of 2009, JavaScript files, Cascading Style Sheets (CSS), images, and other files are placed into a resources directory in the root of the web application. For a Maven based application, this is the src/main/webapp/ directory. Sub-directories under this directory are referred to as libraries. Any library can be created there, and the libraries for css, images, and javascript are the common ones.
Read the rest of this entry »

Date and Time Helper Class

without comments

Introduction

This post introduces the methods of a helper class designed to retrieve system dates and times and supports formatting of dates and times from other sources. Helper classes are used to provide a specific function to assist the overall goal of the application and are different from so-called Utility classes.
Read the rest of this entry »

Written by admin

January 23rd, 2014 at 6:01 pm

Startup Servlet

without comments

Introduction

This post is about using a servlet to perform the initialization of a web application. In an RPG program this would be performed using *INZSR but for web applications a servlet is used. This approach allows tasks to be performed only when the server starts. Since the servlet is part of the application the tasks performed are tailored for it alone.
Read the rest of this entry »

Written by admin

January 18th, 2014 at 6:47 pm