Recent Notes

Displaying keyword search results 1 - 7
Created by Fang on November 08, 2011 20:55:00    Last update: November 21, 2011 18:19:44
In the simple taglib example , I used a tag handler class to implement a taglib. This is an example to implement a taglib with a UI component. The purpose is to use a custom tag to split a string and print each part in a separate paragraph, i.e., print <p>john</p> <p>steve</p> <p>mike</p> with custom tag <my:foreach> : <my:foreach var="who" value="john steve mike"> ... These are the files: pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0"... src/main/java/com/example/UIForeash.java : package com.example; import java.io.IOExcep... src/main/resources/META-INF/faces-config.xml : <?xml version="1.0" encoding="UTF-8"?> <faces-c... src/main/resources/META-INF/foreach.taglib.xml : <?xml version="1.0" encoding="UTF-8"?> <facelet... How to use: Put the JAR file generated by the above project in the WEB-INF/lib folder of the web app. If the web app is a Maven project, just add the taglib project as a dependency:...
Created by mee2 on November 20, 2011 21:00:58    Last update: November 20, 2011 21:10:22
Alfresco community-4.0.b has only 64-bit installer for Linux. These are the steps to manually install it on 32-bit Ubuntu Linux. Download alfresco-community-4.0.b.zip from http://wiki.alfresco.com/wiki/Download_and_Install_Alfresco . Install dependencies: $ sudo apt-get install imagemagick swftools postgr... Note: swftools was not available as a package for Ubuntu 11.10, I installed it with source . Create alfresco database: $ sudo bash [sudo] password for alfresco: ... Copy everything from the Alfresco web-server folder to Tomcat: $ cp -R alfresco-community-4.0.b/web-server/* apac... Edit $TOMCAT_HOME/conf/catalina.properties , change shared.loader to: shared.loader=${catalina.base}/shared/classes,${ca... Edit Tomcat conf file conf/server.xml , add URIEncoding="UTF-8" : <Connector port="8080" protocol="HTTP/1.1" ... Customize alfresco-global.properties : $ mv shared/classes/alfresco-global.properties.sam... Edit shared/classes/alfresco-global.properties : ############################### ## Common A... Copy keystore files from alfresco.war : expand alfresco.war , grab the whole keystore directory from...
Created by Fang on September 07, 2009 20:44:15    Last update: November 03, 2011 14:43:19
Step 1: Repackage a web app as EAR A Java EE application is a multimodule Maven project. At the very least you'll need to package a WAR and an EAR. To get started, I'll simply re-package the simple webapp as an EAR. Create a directory named javaee-app Copy the webapp from here to javaee-app . Rename struts1app to webapp . Create pom.xml under javaee-app : <project> <modelVersion>4.0.0</modelVersion>... Create a directory named ear under javaee-app . Create pom.xml under ear : <project> <modelVersion>4.0.0</modelVersion>... Modify pom.xml in the webapp directory so that it looks like this: <project> <modelVersion>4.0.0</modelVersion> ... Build with " mvn package " in the javaee-app directory. You can see that ear-1.0.ear is successfully generated in javaee-app/ear/target . Maven successfully resolves dependencies between the sub-projects....
Created by alfa on July 01, 2011 13:16:12    Last update: July 01, 2011 13:16:12
This is a simple doclet that prints all public methods and their parameter names and types. Code import com.sun.javadoc.*; public class List... Compile javac -cp $JAVA_HOME/lib/tools.jar:. ListMethodsDo... Use javadoc -doclet ListMethodsDoclet -sourcepath /pat...
Created by voodoo on July 11, 2009 15:14:55    Last update: July 29, 2010 22:45:48
cURL is a command line tool for transferring files with URL syntax. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations. It's really easy to see HTTP headers with curl: C:\>curl --head http://www.google.com HTTP/1.0 ... or, headers and page together (dump headers to stdout): $ curl --dump-header - http://www.google.com HTTP/... Download openssl from openssl.org: curl http://www.openssl.org/source/openssl-0.9.6m.... C:\>curl --help Usage: curl [options...] <url> ...
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 21, 2009 03:05:23    Last update: August 22, 2009 22:10:06
There are three built-in build lifecycles: default: handles your project deployment clean: handles project cleaning site: handles the creation of your project's site documentation Each of these build lifecycles is defined by a different list of build phases, wherein a build phase represents a stage in the lifecycle. The default lifecycle has the following most common build phases (among others): Phase Description validate validate the project is correct and all necessary information is available compile compile the source code of the project test test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed package take the compiled code and package it in its distributable format, such as a JAR. integration-test process and deploy...