iSeries EGL

All things EGL for the iSeries / i5 / Power System

Archive for the ‘Uncategorized’ Category

A Starting Template for a RichUI Handler

leave a comment »

Introduction

This post presents source code to be used as a starting point for coding a Rich UI handler. Presented are two variations giving a “minimalist” appearance based on the philosophy of “less is more”. The screens are not exposed to an internet based audience where flashy presentations designed to capture and keep the attention of the user is not a requirement. On the contrary, the screens are deliberately austere in appearance allowing the user to focus on the task at hand which is to enter and/or maintain information as it relates to the business where distractions impacting accuracy must be minimized.

Design Features

The source creates a header for a title and an area below it for a collection of menu items. The menu items are just place holders to indicate this is the area where they should reside and until logic is added they essentially do nothing. If the page design does not require menu options the developer should delete them but leave the bar in which they would normally reside.

Adding a menu option begins by right-clicking on the grid layout component and adding a new column within which the option will reside. (Click to enlarge.)


What remains below the menu bar constitutes the main body of the web page which is further divided into two sections. The first section is intended to contain widgets allowing for input of data to be provided by the user. The user data supplied is then used to retrieve information from the database to be presented in the second section that is presented below the first. If there are no business requirements that must allow the user to enter such data (i.e. part number, customer account number, policy number, etc.) then the first section should be deleted.

As mentioned above, the second section constitutes the main area where data is presented. More often than not the data presented here is retrieved using user-supplied data provided in widgets contained in the first section described above. If the application is a browse/select type where the user is allowed to see a list of data then a data grid would be presented in this section. As another example, if the first section allows for information to be entered for a new inventory item number, a customer account number or policy number, the second section would then be filled with the appropriate widgets or components to display the related data for the purpose of inquiry or maintenance.

Because the two sections are contained in a title pane the user can collapse them by selecting the downward pointing arrow at the left of each of the pane’s titles. The user may select the arrow after supplying select criteria or a policy number to retrieve the information related to minimize its space on the browser screen.

The Source Code

Presented below is source code for a Rich UI handler that acts as a template or starting point for all web applications. Using a template such as this will serve to ensure all web pages are presented with a uniform appearance and behavior. This in turn will minimize training time and expense and ensure the user’s understanding of screen behavior can be applied to the next application in the system without having to rely upon guessing.

Source Template for a Rich UI Handler – Variation 1

Presented below is the source code for the first variation of the overall look which can be best described as having a “minimalist” appearance.

package com.app.pagetemplate.client;

// RUI Handler

//Remove one of the following sets of imports as needed.

//************************************************
//*  Imports for Open Source Verion of EGL
//************************************************
import org.eclipse.edt.rui.widgets.GridLayout;
import org.eclipse.edt.rui.widgets.GridLayoutData;
import org.eclipse.edt.rui.widgets.TextLabel;
import org.eclipse.edt.rui.widgets.Image;
import org.eclipse.edt.rui.widgets.GridLayoutLib;
import org.eclipse.edt.rui.widgets.Box;
import dojo.widgets.DojoMenu;
import dojo.widgets.DojoMenuItem;
import dojo.widgets.DojoTitlePane;
import org.eclipse.edt.rui.widgets.Div;

//************************************************
//*  Imports for EGL RBD (RDi plugin)
//************************************************
import com.ibm.egl.rui.widgets.Div;
import com.ibm.egl.rui.widgets.GridLayout;
import com.ibm.egl.rui.widgets.GridLayoutData;
import com.ibm.egl.rui.widgets.GridLayoutLib;
import com.ibm.egl.rui.widgets.Image;
import com.ibm.egl.rui.widgets.TextLabel;
import egl.io.sql.column;
import egl.ui.color;
import dojo.widgets.DojoMenu;
import dojo.widgets.DojoMenuItem;
import dojo.widgets.DojoTitlePane;


//
//

handler WebPageTemplate type RUIhandler{ initialUI =[ui
            ], onConstructionFunction = start, cssFile = "css/WebPageTemplateProject.css", title = "WebPageTemplate"}

    ui GridLayout{columns = 3, rows = 5, cellPadding = 4, children = [ BodyPane, ControlPane, MenuBar, GridLayout],
    	width = "1400",
    	position = "relative",
    	x = 50,
    	y = 10,
    	borderColor = "LightGrey",
    	borderWidth = 1,
    	borderStyle = "solid"};
    GridLayout GridLayout{ layoutData = new GridLayoutData{ row = 1, column = 2 }, cellPadding = 4, rows = 1, columns = 3,
    	children = [ Image, GridLayout1],
    	borderColor = "LightGrey",
    	borderStyle = "solid",
    	borderWidth = 1,
    	width = "1350" };
    MigDepartmentName TextLabel{ layoutData = new GridLayoutData{ row = 1, column = 1 }, text = "Department Name",
    	fontSize = "26",
    	fontWeight = "bold" };
    MigApplicationName TextLabel{ layoutData = new GridLayoutData{ row = 2, column = 1 }, text = "The Application Name",
    	fontSize = "18" };
    GridLayout1 GridLayout{ layoutData = new GridLayoutData{ row = 1, column = 2 }, cellPadding = 4, rows = 2, columns = 3,
    	children = [ MigApplicationName, MigDepartmentName] };
    Image Image{ layoutData = new GridLayoutData{ row = 1, column = 3,
    	horizontalAlignment = GridLayoutLib.ALIGN_RIGHT },
    	src = "MigLogo03.png"};
    MenuBar GridLayout{ layoutData = new GridLayoutData{ row = 2, column = 2,
    	cellPadding = 0 }, cellPadding = 4, rows = 1, columns = 3,
    	backgroundColor = "RGB(245,245,245)",
    	width = "1350",
    	children = [ InnerMenuLayout ],
    	padding = 0,
    	margin = 0,
    	height = "40" 
    	  };
    HelpMenu DojoMenu{ layoutData = new GridLayoutData{ row = 1, column = 3 }, text = "Help", children = [
		new DojoMenuItem {
			text = "Item 1, please set onClick", iconClass = "dijitEditorIcon dijitEditorIconCut"
		},
		new DojoMenuItem {
			text = "Item 2, please set iconClass", iconClass = "dijitEditorIcon dijitEditorIconCopy"
		},
		new DojoMenuItem {
			text = "The next item is a separator"
		},
		new DojoMenuItem { },
		new DojoMenuItem {
			text = "Item 3, this one is disabled", disabled = true
		}
	],
    	height = "22"};
    FileMenu DojoMenu{ layoutData = new GridLayoutData{ row = 1, column = 1 }, text = "File", children = [
		new DojoMenuItem {
			text = "Item 1, please set onClick", iconClass = "dijitEditorIcon dijitEditorIconCut"
		},
		new DojoMenuItem {
			text = "Item 2, please set iconClass", iconClass = "dijitEditorIcon dijitEditorIconCopy"
		},
		new DojoMenuItem {
			text = "The next item is a separator"
		},
		new DojoMenuItem { },
		new DojoMenuItem {
			text = "Item 3, this one is disabled", disabled = true
		}
	],
    	height = "22"};
    EditMenu DojoMenu{ layoutData = new GridLayoutData{ row = 1, column = 2 }, text = "Edit", children = [
		new DojoMenuItem {
			text = "Item 1, please set onClick", iconClass = "dijitEditorIcon dijitEditorIconCut"
		},
		new DojoMenuItem {
			text = "Item 2, please set iconClass", iconClass = "dijitEditorIcon dijitEditorIconCopy"
		},
		new DojoMenuItem {
			text = "The next item is a separator"
		},
		new DojoMenuItem { },
		new DojoMenuItem {
			text = "Item 3, this one is disabled", disabled = true
		}
	],
    	height = "22"};
    InnerMenuLayout GridLayout{ layoutData = new GridLayoutData{ row = 1, column = 1,
    	verticalAlignment = GridLayoutLib.VALIGN_MIDDLE,
    	horizontalAlignment = GridLayoutLib.ALIGN_LEFT }, cellPadding = 4, rows = 1, columns = 3,
    	children = [ HelpMenu, EditMenu, FileMenu],
    	height = "32" };
    ControlPane DojoTitlePane{ layoutData = new GridLayoutData{ row = 3, column = 2 }, title = "Control Pane", isOpen=true, duration=1000, width = "1350", children = [ new Div {
    	children = [ ControlPaneGridLayout ]
    } ] };
    ControlPaneGridLayout GridLayout{ cellPadding = 4, rows = 3, columns = 3 };
    BodyPane DojoTitlePane{ layoutData = new GridLayoutData{ row = 4, column = 2 }, title = "Main Data Pane", isOpen=true, duration=1000, width = "1350", children = [ new Div {
    	children = [ BodyPaneGridLayout ]
    } ] };
    BodyPaneGridLayout GridLayout{ cellPadding = 4, rows = 3, columns = 3 };


    function start()
    	
    	MigDepartmentName.text = "Information Technology";
       	MigApplicationName.text = "Application Name";
       	ControlPane.title = "Control Pane Title";
       	BodyPane.title = "Body Pane Title";
       	
       	//Startup Processing to get Runtime Environment and to read properties from XML file.
       	
       	
    end
end

Fig.1 – Source template for a Rich UI handler

 

Shown below is a screen shot for the above source code.

 
 

Source Template for a Rich UI Handler – Variation 2

Presented below is the source code for the second variation of the overall look. The only difference is the header section containing the title which has been filled with a blue color ( backgroundColor = “RGB(40,95,175)” ) with a white color for the title font.

package com.app.pagetemplate.client;

// RUI Handler

//Remove one of the following sets of imports as needed.

//************************************************
//*  Imports for EGL CE
//************************************************
import org.eclipse.edt.rui.widgets.GridLayout;
import org.eclipse.edt.rui.widgets.GridLayoutData;
import org.eclipse.edt.rui.widgets.TextLabel;
import org.eclipse.edt.rui.widgets.Image;
import org.eclipse.edt.rui.widgets.GridLayoutLib;
import org.eclipse.edt.rui.widgets.Box;
import dojo.widgets.DojoMenu;
import dojo.widgets.DojoMenuItem;
import dojo.widgets.DojoTitlePane;
import org.eclipse.edt.rui.widgets.Div;

//************************************************
//*  Imports for EGL RBD (RDi plugin)
//************************************************
import com.ibm.egl.rui.widgets.Div;
import com.ibm.egl.rui.widgets.GridLayout;
import com.ibm.egl.rui.widgets.GridLayoutData;
import com.ibm.egl.rui.widgets.GridLayoutLib;
import com.ibm.egl.rui.widgets.Image;
import com.ibm.egl.rui.widgets.TextLabel;
import egl.io.sql.column;
import egl.ui.color;
import dojo.widgets.DojoMenu;
import dojo.widgets.DojoMenuItem;
import dojo.widgets.DojoTitlePane;
//
//

handler WebPageTemplate type RUIhandler{ initialUI =[ui
            ], onConstructionFunction = start, cssFile = "css/WebPageTemplateProject.css", title = "WebPageTemplate"}

    ui GridLayout{columns = 3, rows = 5, cellPadding = 4, children = [ BodyPane, ControlPane, MenuBar, GridLayout],
    	width = "1400",
    	position = "relative",
    	x = 50,
    	y = 10,
    	borderColor = "LightGrey",
    	borderWidth = 1,
    	borderStyle = "solid"};
    GridLayout GridLayout{ layoutData = new GridLayoutData{ row = 1, column = 2 }, cellPadding = 4, rows = 1, columns = 3,
    	children = [ Image, GridLayout1],
    	borderColor = "LightGrey",
    	borderStyle = "solid",
    	borderWidth = 1,
    	width = "1350",
    	backgroundColor = "RGB(40,95,175)" };
    MigDepartmentName TextLabel{ layoutData = new GridLayoutData{ row = 1, column = 1 }, text = "Department Name",
    	fontSize = "26",
    	fontWeight = "bold",
    	color = "White" };
    MigApplicationName TextLabel{ layoutData = new GridLayoutData{ row = 2, column = 1 }, text = "The Application Name",
    	fontSize = "18",
    	color = "White" };
    GridLayout1 GridLayout{ layoutData = new GridLayoutData{ row = 1, column = 2 }, cellPadding = 4, rows = 2, columns = 3,
    	children = [ MigApplicationName, MigDepartmentName] };
    Image Image{ layoutData = new GridLayoutData{ row = 1, column = 3,
    	horizontalAlignment = GridLayoutLib.ALIGN_RIGHT },
    	src = "MigLogo04.png"};
    MenuBar GridLayout{ layoutData = new GridLayoutData{ row = 2, column = 2,
    	cellPadding = 0 }, cellPadding = 4, rows = 1, columns = 3,
    	backgroundColor = "RGB(245,245,245)",
    	width = "1350",
    	children = [ InnerMenuLayout ],
    	padding = 0,
    	margin = 0,
    	height = "40" 
    	  };
    HelpMenu DojoMenu{ layoutData = new GridLayoutData{ row = 1, column = 3 }, text = "Help", children = [
		new DojoMenuItem {
			text = "Item 1, please set onClick", iconClass = "dijitEditorIcon dijitEditorIconCut"
		},
		new DojoMenuItem {
			text = "Item 2, please set iconClass", iconClass = "dijitEditorIcon dijitEditorIconCopy"
		},
		new DojoMenuItem {
			text = "The next item is a separator"
		},
		new DojoMenuItem { },
		new DojoMenuItem {
			text = "Item 3, this one is disabled", disabled = true
		}
	],
    	height = "22"};
    FileMenu DojoMenu{ layoutData = new GridLayoutData{ row = 1, column = 1 }, text = "File", children = [
		new DojoMenuItem {
			text = "Item 1, please set onClick", iconClass = "dijitEditorIcon dijitEditorIconCut"
		},
		new DojoMenuItem {
			text = "Item 2, please set iconClass", iconClass = "dijitEditorIcon dijitEditorIconCopy"
		},
		new DojoMenuItem {
			text = "The next item is a separator"
		},
		new DojoMenuItem { },
		new DojoMenuItem {
			text = "Item 3, this one is disabled", disabled = true
		}
	],
    	height = "22"};
    EditMenu DojoMenu{ layoutData = new GridLayoutData{ row = 1, column = 2 }, text = "Edit", children = [
		new DojoMenuItem {
			text = "Item 1, please set onClick", iconClass = "dijitEditorIcon dijitEditorIconCut"
		},
		new DojoMenuItem {
			text = "Item 2, please set iconClass", iconClass = "dijitEditorIcon dijitEditorIconCopy"
		},
		new DojoMenuItem {
			text = "The next item is a separator"
		},
		new DojoMenuItem { },
		new DojoMenuItem {
			text = "Item 3, this one is disabled", disabled = true
		}
	],
    	height = "22"};
    InnerMenuLayout GridLayout{ layoutData = new GridLayoutData{ row = 1, column = 1,
    	verticalAlignment = GridLayoutLib.VALIGN_MIDDLE,
    	horizontalAlignment = GridLayoutLib.ALIGN_LEFT }, cellPadding = 4, rows = 1, columns = 3,
    	children = [ HelpMenu, EditMenu, FileMenu],
    	height = "32" };
    ControlPane DojoTitlePane{ layoutData = new GridLayoutData{ row = 3, column = 2 }, title = "Control Pane", isOpen=true, duration=1000, width = "1350", children = [ new Div {
    	children = [ ControlPaneGridLayout ]
    } ] };
    ControlPaneGridLayout GridLayout{ cellPadding = 4, rows = 3, columns = 3 };
    BodyPane DojoTitlePane{ layoutData = new GridLayoutData{ row = 4, column = 2 }, title = "Main Data Pane", isOpen=true, duration=1000, width = "1350", children = [ new Div {
    	children = [ BodyPaneGridLayout ]
    } ] };
    BodyPaneGridLayout GridLayout{ cellPadding = 4, rows = 3, columns = 3 };


    function start()
    	
    	MigDepartmentName.text = "Information Technology";
       	MigApplicationName.text = "Application Name";
       	ControlPane.title = "Control Pane Title";
       	BodyPane.title = "Body Pane Title";
       	
       	//Startup Processing to get Runtime Environment and to read properties from XML file.
       	
       	
    end
end



Fig.2 – Source template for a Rich UI handler

 

Shown below is a screen shot for the above source code.

Variation 2

 
 

Advertisements

Written by iseriesadmin

July 13, 2012 at 9:45 pm

EGL and Subversion

leave a comment »

Introduction

Attached to his post is a .PDF document that illustrates how to use Subversion (SVN), which is a version control tool that has been integrated with “Rational Developer for i” (RDi) so that EGL project source can be safe guarded.

The document presents three main topics the first of which covers the installation of Tortoise, a graphical application that provides tools to be used by Subversion administrators to manipulate source code repositories. The tool is not often used once a repository has been created. Although Tortoise is intended for use only by administrators, the topic showing installation and use is presented as background information and for reference purposes. For this reason the developer can skip this topic if they choose. The topics that follow are intended for developers.

After RDi has been installed on the developer’s machine, the document’s second topic shows how to install a plug-in for RDi so that it sees the source code repository. Once installed, the third topic presented provides the ability to enroll projects into the SVN repository, commit changes and manage conflicts with other developers.

Rather than create a somewhat long web-page chock full of images to upload the document can be downloaded by clicking this link.

On some browsers the download may not present the first page. If this occurs simply scroll down using the mouse’s scroll wheel and the first page should appear.
 
 
 
 

Written by iseriesadmin

July 6, 2012 at 6:54 am

Tomcat In Development, Test and Production Environments

leave a comment »

Introduction

This post shows how a JVM variable can be employed on Tomcat’s startup command to declare a server instance as either a development server, a test server or a production server. An application can then retrieve this value during its startup processing phase to determine the database to which a connection must be made. To see how EGL can read this JVM variable value select this link.

Variable Indicating Development, Test and Production Servers

The value assigned to the parameter “runtimeEnvironment” indicates the role of the Tomcat server. For the developer’s server, usually running inside the IDE (RDi) the value for this parameter will be “localhost”. For the test and production Tomcat servers running on the iSeries, there are two valid values which are “TEST” and “PROD”. For example this parameter will designate the server as a production server:

-DruntimeEnvironment=”PROD”

All applications should obtain the value of this variable during its startup phase. For Java, this is a startup servlet. For EGL, it will be a service.

Shown below is the command that starts a Tomcat server. It has been modified to set the environment variable and its value, in this case, ‘PROD’.


java -ms64m -Duser.dir="$CATALINA_BASE" -Dcatalina.base="$CATALINA_BASE" -Dcatalina.home="$CATALINA_HOME" -Djava.awt.headless=true -DruntimeEnvironment="PROD" org.apache.catalina.startup.Bootstrap "$@" start

All parameter name/value pairs begin with “-D”.

Why Do This?

The intent is to inform the application about the role of the server, i.e. the developer’s desktop machine in which case the value will default to “localhost” for the developer’s server, “TEST” for the test server and “PROD” for the production server. Once the value is obtained the application’s logic can then determine the proper database connection to use in addition to reading the correct set of property values established for the application. The diagram shown clarifies this.

Fig.1 – Diagram showing roles of three Tomcat servers defined by a JVM variable (Click to enlarge)

Conclusion

This post revealed how a name/value pair can be established for a given Tomcat server instance so that an application may interrogate the value of the named parameter. With the value obtained the application’s logic can then determine the correct database to which a connection must be made. In this way the development staff can be confident their application can be safely run on a test server with the knowledge that it will not update production data. When it comes time to deploy to the production server, the application does not have to be modified in any way and its logic will again connect to the correct production oriented database as well as being able to obtain the correct values from the application’s property file.

Written by iseriesadmin

June 10, 2012 at 9:57 am

Making a DB Connection during runtime

leave a comment »

Using Tomcat’s JVM parameter values to facilitate DB connections

This post will illustrate how a database connection can be established to one of two separate iSeries machines.

Before we get going, for some background you should probably read this post first. Its is about the configuration of the server’s (Tomcat) JVM property value for run-time environment ‘localhost’, ‘TEST’ and ‘PROD’.

 

The application’s externally defined property values

The application’s configuration data is contained in an external XML file, a common practice in web application development. For this discussion it will suffice to say the application’s configuration data has already been read during the application’s initialization phase conducted when the application is started. During this phase the data is cached into an EGL BasicRecord type i.e. ‘configDataRecord’ which can then be passed to the application’s services as a parameter. In this manner all services can gain access to the application’s configuration data.

Shown below are the entries placed in our XML configuration file that describe connection criteria for MACH1 and MACH2 used for the developer’s (localhost) server, the test (TEST) machine and the production (PROD) machine. (User id’s and passwords are obfuscated.) Library entries, of which there is only one in this example, are separated by spaces. Note the libraries established for each machine for each development environment. In this way, each connection for each machine is assigned to the correct library ensuring the proper set of data is used for each environment. This method ensures that the developer does not have to prefix or qualify SQL statements with embedded library names, which does not translate well when moving the application from a TEST server to a PROD server.


<entry key="localhost.MACH1MachineId">MACH1</entry> <entry key="localhost.MACH1UserID">**********</entry> <entry key="localhost.MACH1Password">**********</entry> <entry key="localhost.MACH1URL">jdbc:as400:MACH1;prompt=false;naming=system;libraries=DEVLIB;transaction isolation=none;</entry> <entry key="localhost.MACH2MachineId">MACH2</entry> <entry key="localhost.MACH2UserID">**********</entry> <entry key="localhost.MACH2Password">**********</entry> <entry key="localhost.MACH2URL">jdbc:as400:MACH2;prompt=false;naming=system;libraries=DEVLIB;transaction isolation=none;</entry> <entry key="TEST.MACH1MachineId">MACH1</entry> <entry key="TEST.MACH1UserID">**********</entry> <entry key="TEST.MACH1Password">**********</entry> <entry key="TEST.MACH1URL">jdbc:as400:MACH1;prompt=false;naming=system;libraries=TESTLIB;transaction isolation=none;</entry> <entry key="TEST.MACH2MachineId">MACH2</entry> <entry key="TEST.MACH2UserID">**********</entry> <entry key="TEST.MACH2Password">**********</entry> <entry key="TEST.MACH2URL">jdbc:as400:MACH2;prompt=false;naming=system;libraries=TESTLIB;transaction isolation=none;</entry> <entry key="PROD.MACH1MachineId">MACH1</entry> <entry key="PROD.MACH1UserID">**********</entry> <entry key="PROD.MACH1Password">**********</entry> <entry key="PROD.MACH1URL">jdbc:as400:MACH1;prompt=false;naming=system;libraries=PRODLIB;transaction isolation=none;</entry> <entry key="PROD.MACH2MachineId">MACH2</entry> <entry key="PROD.MACH2UserID">**********</entry> <entry key="PROD.MACH2Password">**********</entry> <entry key="PROD.MACH2URL">jdbc:as400:MACH2;prompt=false;naming=system;libraries=PRODLIB;transaction isolation=none;</entry>

Fig.1 – The application’s XML configuration file

 

Making the Connection

Shown below is the EGL code that resides in an EGL service program. The variable ‘server’, passed to the function containing this code, is used to govern which set of logic is to be executed. The value determines the values for the variables ‘machineID’, ‘userid’ and ‘password’.

Once these values are obtained the value for ‘runtimeEnvironment’ is used to obtain the correct connection string or URL. For localhost, this value will come from the XML configuration data. For TEST or PROD, the connection URL is obtained from the JNDI-defined connection criteria established in Tomcat’s context.xml file. See this post for information about that.


//Obtain the runtimeEnvrionment variable from the configuration data cache runtimeEnvironment = StrLib.clip(configDataRecord.runtimeEnvironment); //The program defined variable 'server' contains either 'MACH1' or 'MACH2' if (server == configDataRecord.MACH1MachineId) machineID = configDataRecord.MACH1MachineId; userid = configDataRecord.MACH1UserID; password = configDataRecord.MACH1Password; if (runtimeEnvironment == CommonLibrary.CONST_LOCALHOST) connectionString = configDataRecord.MACH1URL; end if (runtimeEnvironment == CommonLibrary.CONST_TEST) connectionString = "jdbc/MACH1"; end if (runtimeEnvironment == CommonLibrary.CONST_PROD) connectionString = "jdbc/MACH1"; end end if (server == configDataRecord.MACH2MachineId) machineID = configDataRecord.MACH2MachineId; userid = configDataRecord.MACH2UserID; password = configDataRecord.MACH2Password; if (runtimeEnvironment == CommonLibrary.CONST_LOCALHOST) connectionString = configDataRecord.MACH2URL; end if (runtimeEnvironment == CommonLibrary.CONST_TEST) connectionString = "jdbc/MACH2"; end if (runtimeEnvironment == CommonLibrary.CONST_PROD) connectionString = "jdbc/MACH2"; end end //Make the connection sqlLib.connect(connectionString, userid, password);

Fig.2 – Tomcat’s context.xml

 

Problem? What problem?

While everything explained so far is accurate, there is one problem, if it can be called that. It’s more of a developmental artifact than anything else and can be spotted in the configuration file. Everything will still work, but there are entries which have been rendered superfluous. Can you spot the problem? Hint: see the JNDI entries for comparison. Post your thoughts on this in the comments section below this post.

 

Summary

So, there we have it. We’ve seen how Tomcat configuration and the application’s externally defined property values can facilitate connections to a given database for a whole list of different machines. The value of this effort should be self-evident, that is, it does not promote hard-coded connection criteria in the application’s code which, without modifications, would prohibit deployment across multiple run time environments represented by the developer’s machine, the test or QA machine and finally the production machine.