Recent Notes

Displaying keyword search results 41 - 50
Created by Dr. Xi on February 10, 2010 23:39:37    Last update: February 10, 2010 23:39:37
Example web.xml that includes most frequently used elements. This sample is for Servlet Specification 2.4. <?xml version="1.0" encoding="UTF-8"?> <web-ap...
Created by Dr. Xi on December 11, 2007 22:10:28    Last update: January 14, 2010 03:39:31
The subroutine recurse traverses a directory tree. The function to be performed, which works on the current file with optional parameters, is passed in as a parameter. # perl - recursive dirctory tasks # 1. recursiv...
Created by Fang on August 22, 2009 21:48:12    Last update: January 10, 2010 00:29:08
The POM (Project Object Model, pom.xml ) is at the heart of all Maven builds. It tells Maven how to build your project, just like build.xml for Ant. This is a POM for a simple Hello World project: <project xmlns="http://maven.apache.org/POM/4.0.0"... Not much can be inferred from the POM file alone, because lots of information is implied . For example, packaging defaults to jar , which means that if nothing is specified, Maven compiles all java files under src/main/java and creates a jar . All Maven POMs inherit from a base Super POM. To see the effective POM for your project, type mvn help:effective-pom : C:\maven\hello-world>mvn help:effective-pom Below is the Super POM for Maven 2.0.x. <project> <modelVersion>4.0.0</modelVersion> ...
Created by Fang on August 13, 2009 03:32:36    Last update: January 09, 2010 21:34:34
Maven asks you to organize your project by a standard directory layout. Although you can override the proposed structure via the project descriptor , conformance is strongly recommended. At the top level there are only two directories: src and target . The target directory is used to house all output of the build. The src directory contains all of the source material for building the project, its site and so on. The src directory contains a subdirectory for each type of resources: main for the main build artifact test for the unit test code site for your project site's documentation This is the general layout: Directory Description LICENSE.tx t Project's license README.txt Project's readme pom.xml The Maven "Project Object Model" src/main/java under which the normal...
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="http://maven.apache.org/POM/4.0.0"... Create settings.xml in $HOME/.m2 , add Java.net 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="http://maven.apache.org/POM/4.0.0"... Create a directory named java under main , create the Struts form and...
Created by Fang on August 13, 2009 04:18:26    Last update: August 13, 2009 04:18:26
To start a simple "Hello World" project in maven, enter: mvn archetype:create -DgroupId=com.example -Dartif... in the command line. It will take a while for Maven to run. But eventually it will create the standard Maven directory structure with a "Hello World" app and a fake JUnit test. Enter mvn package will build the simple App into a jar under the target directory. Run the resulting App: C:\maven\hello-world>java -cp target\hello-world-1... This is the generated pom: <project xmlns="http://maven.apache.org/POM/4.0.0"...
Created by Dr. Xi on September 15, 2008 18:19:44    Last update: September 15, 2008 18:19:44
Some Ant built-in properties: Property Description basedir the absolute path of the project's basedir (as set with the basedir attribute of <project>). ant.file the absolute path of the buildfile. ant.version the version of Ant ant.project.name the name of the project that is currently executing. It is set in the name attribute of <project>. ant.java.version the JVM version Ant detected; currently it can hold the values "1.2", "1.3", "1.4" and "1.5". ant.home home directory of Ant In addition, Ant provides access to all system properties as if they had been defined using a <property> task. For example, ${os.name} expands to the name of the operating system.
Created by Dr. Xi on September 04, 2008 18:18:07    Last update: September 04, 2008 18:18:07
If the argument to getResourceAsStream is a directory, the stream content returns a list of files under that directory. The following code returns the list of files under the first directory on CLASSPATH (not the current directory): import java.io.*; public class TestGetResou...
Created by Dr. Xi on May 14, 2008 22:55:22    Last update: May 14, 2008 23:07:49
This procedure works for Oracle application server 10.1.3.1, SOA suite. But should be applicable for standalone OC4J or JDeveloper installations with minor modifications. $ORACLE_HOME is the home directory for Oracle app server. $JDEV_HOME is the home directory for JDeveloper. 1. Change directory to $ORACLE_HOME/j2ee , mkdir lib 2. Copy xmlparserv2.jar from $JDEV_HOME to $ORACLE_HOME/j2ee/lib . 3. Copy ocj.jar and jdev_remote.jar from $JDEV_HOME/jdev/lib to $ORACLE_HOME/j2ee/home/lib . 4. Edit global-web-application.xml under your OC4J instance's config directory. Change the development attribute to true . <orion-web-app xmlns:xsi="http://www.w3.org/... 5. Add the following to the servlet section of global-web-application.xml : <servlet> <servlet-name>jsp</servlet-na... 6. Edit $ORACLE_HOME/opmn/conf/opmn.xml , add -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 to start-parameters/java-options : <process-type id="MYOC4J" module-id="OC4J" status=... 7. In Eclipse, open to port 4000 for remote debugging.
Created by Dr. Xi on September 06, 2007 22:22:04    Last update: September 06, 2007 22:22:28
This is an improved version with recursive capabilities. #!/bin/perl # find jar containing specified fil...
Previous  1 2 3 4 5 6 Next