Recent Notes

Displaying keyword search results 21 - 30
Created by Dr. Xi on January 08, 2010 03:53:37    Last update: January 08, 2010 03:54:56
This is an Ant custom task to merge Properties files I lifted from , with some minor bug fixes. Example usage: <taskdef name="mergeProperty" classname="ant.task.... Implementation: package ant.task.addon; import
Created by Dr. Xi on November 19, 2008 00:22:27    Last update: January 07, 2010 23:00:36
There is a open source project named [ini4j] for processing Windows .ini configuration files. However, I found it an overkill for my purposes. So here is my simple implementation of a .ini parser. It mimics the standard java.util.Properties class with enhancements to get and set properties by section name. There are only a few simple rules: Leading and trailing spaces are trimmed from section names, property names and property values. Section names are enclosed between [ and ] . Properties following a section header belong to that section Properties defined before the appearance of any section headers are considered global properties and should be set and get with no section names. You can use either equal sign ( = ) or colon ( : )...
Created by Fang on September 07, 2009 16:39:37    Last update: September 07, 2009 18:43:04
It's easiest to use the archetype plugin to start a new Maven project. I'll use struts 1 as example since it's not in the built-in archetypes for archetype:generate . Generate a simple webapp with archetype:generate : C:\work\maven>mvn archetype:generate -DarchetypeAr... It generates a directory structure like this: struts1app struts1app/pom.xml struts1app/src... with a simple POM: <project xmlns=""... Create settings.xml in $HOME/.m2 , add repository for Java EE dependencies: <?xml version="1.0" encoding="UTF-8"?> <setting... Add Java EE and Struts dependencies in pom.xml . Note that the Java EE dependency has scope provided , meaning that the web app container provides the jars, therefore we don't need to bundle them with our war fie. <project xmlns=""... Create a directory named java under main , create the Struts form and...
Created by Dr. Xi on April 30, 2009 23:26:13    Last update: May 01, 2009 17:08:49 contains these keys: test.key.1 = Test Key One test.key.2 = Test Key... Struts (struts-el): <%@ page contentType="text/html;charset=UTF-8" lan... JSTL <%@ page contentType="text/html;charset=UTF-8" lan... However, the values for one and two must be passed in from pageScope , requestScope , sessionScope , etc. Values defined by struts bean:define are not interpreted. Important: JSTL tags work with servlet spec 2.4 only. So your web.xml must start with this: <?xml version = '1.0' encoding = 'windows-1252'?> ... Not this: <?xml version = '1.0' encoding = 'windows-1252'?> ... However, the latter does work with struts-el tags.
Created by Dr. Xi on October 15, 2008 19:49:31    Last update: October 15, 2008 19:49:31
Ant script: <?xml version="1.0"?> <project name="OC4JDe... Deployment properties: # Deployment properties targetenv=Development ...
Created by Dr. Xi on September 15, 2008 19:50:39    Last update: September 15, 2008 20:01:50
Create a properties file to hold the properties for the MailLogger: MailLogger... Invoke from command line: ant\Build\MailLogg... Alternatively, invoke from another ant script: <target name="build" depends="checkout"> <e... However, the built-in MailLogger doesn't override buildStarted . Therefore, you can't send email to notify of build starting with MailLogger . To achieve that, you can either use the Mail task or override MailLogger with your own derivative.
Created by Dr. Xi on September 15, 2008 18:05:01    Last update: September 15, 2008 18:05:01
The Ant tstamp sets the DSTAMP , TSTAMP , and TODAY properties in the current project. But you can use a nested format task to define other properties and format the value. <project name="tstamp_demo" basedir="." default="d...
Created by Dr. Xi on August 16, 2007 18:47:40    Last update: August 16, 2007 18:52:02
If you use quartz or the plain old java.util.Timer class to schedule jobs in an OC4J container, you need to enable the -userThreads switch with the OC4J container. This is the relevant section in $ORACLE_HOME/opmn/conf/opmn.xml : <process-type id="INST1" module-id="OC4J" status="... Or, you can add it through the Oracle em console. Go to the OC4J container, click "Administration" tab, then "Server Properties". Add "-userThreads" to "Start-parameters: OC4J Options". Debu Panda has written a good article on using quartz in the Oracle environment: Using Quartz Enterprise Scheduler in J2EE
Created by Dr. Xi on August 13, 2007 21:40:47    Last update: August 13, 2007 22:29:32
This page loads text messages from under WEB-INF/classes and uses them within the page: <%@ taglib uri="" pref... Contents of : title=Weight Watcher greetings=Good morning {0}...
Created by Dr. Xi on August 10, 2007 21:05:26    Last update: August 10, 2007 21:05:26
This style sheet transforms the struts-config.xml into HTML for easy viewing in a browser. It uses the DHTML JavaScript tooltip from . <?xml version="1.0" encoding="UTF-8"?> <xsl...
Previous  1 2 3 Next