Thursday, August 24, 2006

Cool Google Tools

I found another interesting site provided by Google called Google Code .
Google released a new product called Project Hosting for open source community to share codes and facilitate software development.
Source: Google Project Hosting .

Wednesday, August 23, 2006

Language Learning

Machine Learning is a very interesting topic for computer scientists.

Source: http://staff.science.uva.nl/~pietera/ALS/

The well-known specialist in neural networks Kohonen developed the idea of Dynamically Expanding Context (DEC) grammars. He applied the concept successfully to, among other things, musical composition. The basic idea behind DEC-grammars is the notion that the occurrence of a symbol in a string is determined by its predecessors. A DEC-grammar consists of rules that determine which symbol can occur in which context. A context is a string symbols that precedes a symbol. A rule of a DEC-grammar has the following form:
X => y
Here ‘X’ is a context, ‘y’ is a symbol. These rules can be used to generate a string of symbols: in context ‘X’ write symbol ‘y’.

The algorithm to learn a DEC-grammar (i.e. to find a DEC-Grammar which describes a particular string) is very simple. Say you want to find a DEC-Grammar for the string ‘^abae’. You start to read the first symbol of the string, and you form the rule:
^ => a
Then you read the next symbol (which is ‘b’) and you form the rule:
a => b
You proceed along these lines, generating rules, until you obtain the grammar:
^ => a
a => b
b => a
a => e
This grammar is not deterministic anymore, because there are two possible successors of ‘a’, namely ‘b’ and ‘e’. In order to repair this you update the rules in the grammar that violate the deterministic structure by expanding their context as necessary: (a => b) is replaced by (^a => b) and (a => e) is replaced by (ba => e). The final grammar becomes:
^ => a
^a => b
b => a
ba => e

Under such a grammar, the algorithm to generate a string (with a maximum length of 200) is:
Begin Pseudo-Code:
Input: DEC-grammar G
CONTEXT := ^
COUNT := 0
While ((COUNT < 200) AND (G contains a rule (X => y) such that there is a (possible empty) string S such that S+X = CONTEXT)) do
COUNT := COUNT + 1
CONTEXT := CONTEXT + y
End While
End Pseudo-Code:


When I was searching some stuff related to generic classes in Java, I found a good web site http://www.java2s.com/ , which contains a lot of useful code in several languages.

Wednesday, August 16, 2006

Creating a Thread Pool with Java

I've mentioned before that J2SE5 proposed a new feature called ThreadPool, but this class cannot really make a pool with a fixed size.
There's good article about creating a thread pool with Java, which I believe it was written before the release of JDK1.5, because it says there's no such a feature in Java. This article is available in Creating a Thread Pool with Java .

Monday, August 14, 2006

Design patterns for J2EE and XML

The Java BluePrints is the main source of J2EE design patterns.

Presentation Layer Patterns
Patterns in presentation layer
(1) the Decorating Filter Pattern involves applying inbound and outbound filters to modify client request and response data across distinct request types. It useful when a general piece of logic needs to be applied globally to many types of user interactions.
(2) the Model-View-Controller Pattern, which uses controller to collect client requests, and update backend data model, and then dispatch the request to the view component which renders the user interface.

Application and Service Layer Patterns
These patterns focus on increasing the flexibility, maintainability, and modularity of the internal application components.
(1) the Service Locator Pattern hides the complexity of locating remote services. The concept behind this pattern is to provide a simple API for obtaining a reference to a service component.
(2) the Business Delegate Pattern is employed to simplify client access to a particular application service. A business delegate object acts as a proxy between application clients and the service, and it's often a dependent object used by servlet and EJBs.
(3) the Value Object Pattern, a value object is a serializable representation of a complex set of data suitable for passing between application tiers via RMI.
(4) the Data Access Object Pattern is useful for interacting synchronously with a persistent data store. It's commonly used to decouple application components, such as EJBs and servlets, from an underlying database.

Issues with system integration

Systems integration refers to the work of gluing together independent applications, services, and data stores.

4 Levels of Integration
Data Level Integration: it's the simplest architectural pattern for systems integration and the quickest to implement by sharing access to an enterprise data store with one or more other applications.
Message Level Integration: it's the most flexible and best performing of the system integration patterns. Data is packaged and transmitted over the network asynchronously for remote processing.
Procedure Level Integration: it's an extension of message level integration that supports synchronous interaction between system. It's generally referred to as remote procedure calls (RPC) or remote function calls (RFC).
Object Level Integration: it can be used between systems that support a common distributed object architecture, such as CORBA or DCOM, in which some well-know objects act as intermediaries between client and server software object. This intermediary (ORB in CORBA) provides a set of services that clients can use to locate a desired server and invoke it. Once the client locates the service, the server object provides a remote stub of itself to the client that it can use locally. On the server side, there's a client skeleton providing the same proxy functionality to the server object.

SOAP
The SOAP specification addresses 4 main areas: message envelope, encoding rules, RPC support and HTTP binding. A basic SOAP message contains SOAP envelope (the wrapping structure), SOAP header (which contains meta-information specific to a SOAP message itself), SOAP body (which contains the payload of the message, such as an application specific request, response, or an asynchronous message). Both the header and the body can be further structured into SOAP blocks. SOAP can be extended to accomodate non-SOAP attachments to basic SOAP messages.

WSDL
A WSDL file contains 5 groups of information:
(1) data types: the <types> element allows you to derive new XML Schema data types for elements used in your WSDL descriptions.
(2) messages: the <message> element defines messages including parameters.
(3) port types: the <portType> elements are abstract constructs that allow grouping of message definitions into operations. They define request/response interaction without regard to the specifics of the protocol used to exchange the messages.
(4) bindings: a <binding> element maps a port type to a communication mechanism, like SOAP.
(5) web service instances: a <service> element describes an instance of a web service, including where it is located (URI), what its interface is (port), and how to interact with it (binding).

Saturday, August 12, 2006

JSP Core

I collected and summarized the main points about JSP, which are listed below:

Standard JSP Statements
1. JSP comments: <%-- comments --%> , it is not visible to the clients
2. JSP declaration: <%! int k = 5; %>
3. JSP expressions and scriptlets: <%= someValue %>, <% java code %> .

JSP Directives
1. include: <%@include file="relativeURLspec" %> .
2. page: <%@page language/ extends/ import/ session/ buffer/ autoFlush/ isThreadSafe/ info/ errorPage/ contentType/ isErrorPage %> .
3. tag lib: <%@taglib uri="tagLibURI" prefix="tagPrefix" %> .

JSP Actions
1. <jsp:forward page="relativeURL" >
<jsp:param name="pName" value="pValue" />
</jsp:forward >
2. <jsp:include page="relativeURL" flush="true" >
<jsp:param name="pName" value="pValue" />
</jsp:include >

Note the value of flush must be set to true. The difference between action of include and directive of include is that jsp include action is executed at run time, while the directive is executed at compile time.
3. <jsp:plugin type="typebean"/ code="classFile"/ codebase="classDir">
</jsp:plugin >
jsp:plugin is used to download the JavaBeans or Applet from the server and execute them at the client's browser.
4. <jsp:useBean id="name" class="className" scope="page request session application" typeSpec >
</jsp:useBean >
jsp:useBean is the core of the java component technology, and it's used to instantiated one or more JavaBean components.
5. <jsp:setProperty name="BeanName" PropertyExpr/>
jsp:setProperty is used to set the property of a JavaBean.
6. <jsp:getProperty name="BeanName" property="propertyName"/ >.

JSP Internal Objects
1. out: it's used to output data to the clients, and manage the output buffer of the application server. Its base class is javax.servlet.jsp.JspWriter.
2. request: it's used to get the input message from the clients. Its base class is javax.servlet.http.HttpServletRequest.
3. response: it deals with http connection messages, such as cookies and HTTP headers. One important method of Response is sendRedirect, to redirect the clients to other pages:
<%response.sendRedirect("http://zhangyelei.blogspot.com");%> .
The repsonse object can also redirect a page by setting the header information:
<%
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
String newLocn="/newpath/index.html";
response.setHeader("Location",newLocn);
%>
4. exception: it's used to deal with the errors and exceptions during the execution of JSP programms. And it can only be used in a page with a page directive specifying isErrorPage true. The exception object is an instantiated object of the java.lang.Throwable class.
5. config: it's a message sent by the JSP engine to a servlet program when it is initialized. The information includes the parameters for initialization and server information. Use its getServletContext() method can return an application object. The config object is an instantiated object of the javax.servlet.ServletConfig interface.
6. page: it refers to the current JSP program, and it's analogous to "this" in the class file. It's an instantiated object of the java.lang.Object class.
7. application: it's an instantiated object of the javax.servlet.ServletContext interface.
8. session: it's an instantiated object of the javax.servlet.http.HttpSession interface. It's used to store user information.
9. pageContext: it's an intantiated object of the javax.servlet.jsp.PageContext class. It provides accesses to all the JSP objects and namespaces.
10. global.asa file is used to execute some programm when initializing or destroying application and session objects. It has 4 main methods to be defined: applicationInit(), sessionInit(), applicationDestroy(), sessionDestroy().

Servlet
In fact, JSP is developed on the basis of servlet technology, and it's a high-level wrapping of the servlet technolgoy.
Servlet lifecycle:
1. web server loads a servlet.
2. web server instantiates a servlet.
3. web server calls the init() method of the servlet.
4. when the server receives a client request, it create an object of HttpServletRequest, and then an object of HttpServletResponse.
5. web server activates the service() method of the servlet and pass those 2 created objects as parameters.
6. for more requests, web server creates new request and response objects, but still calls the service() method of the same servlet.
7. when the server shuts down, it calls the destroy() method of the servlet.
8. note the init() and destroy() methods only execute once.
Server side include (SSI):
The file use SSI has an extension .shtml, and it's actually a text file containing the include and html tags. SHTML supports 2 kinds of tags: <servlet> and <include> .
The javax.servlet package:
It contains 4 packages: javax.servlet, javax.servlet.http, javax.servlet.jsp and javax.servlet.jsp.tagext. The first one is the basis of the whole servlet API; the second one is the HTTP extension of servlet; the third one is the JSP extension of the servlet; the last one is used to support Tag Library.
javax.servlet: contains ServletConfig interface, ServletContext interface, ServletRequest interface, ServletResponse interface, RequestDispatcher interface, ServletInputStream interface, and ServletOutputStream interface.
javax.servlet.http: contains HttpServletRequest interface, HttpServletResponse interface, HttpSession interface, HttpServlet class, Cookie class, and HttpUtils class.

Friday, August 11, 2006

Concepts in J2EE development

Middleware: it exists to overcome the difference between different computing platforms, and exposes common set of services across platforms and provides a homogeneous computing environment in which distributed application can be built, such as JNDI, JDBC, JMS, JTA, JAF, JAXP and JAAS.

Open System: a system in which components can be implemented in different ways and executed in a variety of environments.

Development Methodology: it defines a process for building software, including the steps to be taken and roles to be played by project team members.
RUP: Rational Unified Process provides a detailed process for object-oriented development, defining a complicated web of processes, activities and tasks to be undertaken by team members in clearly defined roles. It's used for developing a complicated system over a longer timeframe. It might be too thick for J2EE.
EXtreme Programming (XP): it's a lightweight methodology for hackers. It goes from requirements gathering to coding test cases to coding functionality. The number of user stories implemented and the percentage of test cases running successfully at the moment are the measure of success. It's often not appropriate for large development projects. Once concer with XP is that it does not produce sufficient analysis and design documentattion, whcih can be essential in the ongoing maintenance of a system.

J2EE Development Tools:
(1) analysis and design tools: 2 of the most common choices are Rational Rose by Rational Software and Together Control Center by TogetherSoft Corporation.
(2) development tools: 3 of the most commercial IDEs used on J2EE projects are WebGain Studio (integrating best with BEA System's WebLogic development environment), Borland's JBuilder, and IBM's Visual Age (best suitable for WebSphere). If you are using an open source server like JBoss or Enhydra, the most important feature of an IDE may be its ability to integrate with the Ant build tool.
(3) build tools: the deployment of J2EE components involves compiling the components and their related classes, creating deployment descriptors, and packaging the components into JAR, WAR or EAR files. Build tools controls the whole deployment process.The most significant build tool is the Antbuild tool, part of the Aparche Software Foundation's Jakarta open source effort. One of the nicest things about Ant is its protability between operating systems.
(4) source code control tools: the Concurrent Versioning System (CVS) is an open source versioning system used widely throughout the industry.
(5) testing tools: testing can be categorized as unit/functional testing (testing individual components to ensure proper behavior), system testing (testing the functionality of the entire application, including the interactions between components and sub-systems), integration testing (involves testing functionality of the integration between your application and external systems), performance/load testing (used to determine the scalability and discover potential bottlenecks) and user acceptance testing (UAT, getting real users to try the system, examince its functionality, and report gaps between functionality delivered and original requirements). JUnit is a popular open source testing package for Java components, and it has also been extended to do more specific types of testing such as for automated Web testing, there is HTTPUnit, for server-side J2EE testing, there are JUnitEE and Apache's Cactusproject. Testing also involves the use of logging tools like Apache Log4j (logging is built within J2EE methods).
(6) problem tracking tools.

XML-Related Technologies:
(1) XML validation technologies: DTD and XML schema.
(2) XML parsing technologies: an XML parser makes data contained in an XML data structure available to the application that needs to use it. There are 2 distinct modes for XML parsing, event-based model, and document object model (DOM). The first mode is used by the Simple API for XML (SAX). A SAX-based parser reads in the XML data source and makes callbacks to its client application whenever it encounters a distinct section of the XML document, and it cannot look forward in the document during parsing. There are no predefined relationships between nodes in the document. While in the DOM model, the parser will read in an entire XML data source and construct a treelike representation of it in memory.
(3) XML translation technologies: XML translation means to convert and XML data set from one form to another in a generic manner, such as XSLT (eXtensible Stylesheet Language for Transformations). The most popular open source XSLT engine for Java is the Apache Software Foundation's Xalan project.
(4) messaging technologies: SOAP (Simple Object Access Protocol) is a messaging specification describing data encoding and packaging rules for XML-based communication. WSDL (Web Services Description Language) is used to describe web services. UDDI (Universal Description, Discovery and Integration) aims to enable the online registration and lookup of web services via a publicly available repository.
(5) data manipulation and retrieval technologies: XPath, XPointer, XInclude, XLink, XBase, and XQuery.
(6) data storage technologies: storing XML in a textual, unparsed format is inefficient, an alternative mechnism to storing text files is the Persistent Document Object Model (PDOM). PDOM implements the W3C DOM specification but stores the parsed XML document in binary format on the file system. Another alternative to static file system storage is the use of native-XML databases, such as Software AG's Tamino.

Java APIs for XML:
(1) JAXP (Java API for XML Parsing) provides implementation-neutral access to XML parsers and XSLT processors.
(2) JDOM (Java Document Object Model) provides a java-centric, object-oriented implementation of the DOM framework. The use of JDOM does not subvert the JAXP architecture, but builds upon it.
(3) JAXB (Java API for XML Binding) defines a two-way persistent mapping between XML structures and Java objects and enables you to work with XML documents as if they were Java objects. The JAXB development process requires the creation of a DTD and a binding schema- an XML document that defines the mapping between a Java object and its XML schema, which are fed into a schema compiler to generate Java source code. The compiled Java classes handle the details of the XML-Java conversion process. JAXB shows improved performance over SAX and DOM parsers because it's lightweighted and precompiled, but one tradeoff to consider is a loss of system flexibility since any change in your XML or object structures requires recompilation of JAXB classes.
(4) Long Term Java-Beans Persistence provides XML serialization for JavaBean components, which is similar to JAXB. It leverages the JavaBeans component contract instead of a bing schema to define the mapping from Java to XML. Since JavaBeans must define get and set methods for each of their publicly accessible properties, it was possible to develop XML-aware components that can serialize JavaBeans to XML without a binding schema.
(5) JAXM (Java API for XML Messaging) enables the use of SOAP messaging in Java applications, using resource factories in a manner similar to the Java Messaging Service (JMS). The 2 main components of the JAXM architecture are the JAXM Client and Provider. The client provides access to JAXM services from within the application. The provider is responsible for sending and receiving SOAP messages.
(6) JAX-RPC is an XML-RPC implementation API for Java, which is similar to JAXM. Using JAX-RPC, you can expose methods of the beans running in your EJB container to remote Java and non-Java clients.
(7) JAXR (Java API for XML Repositories) provides implementation-neutral access to XML repositories like ebXML and UDDI. It is expected to handle everythign from executing complex registry queries to submitting and updating your own data to a particular registry system.

Source: Kurt A. Gabrick, David, B. Weiss, J2EE and XML development.

Thursday, August 10, 2006

Using Ant in Eclipse

Ant is a widely used compiling tool for many distributed web application. Eclipse provides supports to the Ant tool in the development environment. In order to use Ant Editor in Eclipse, file association should be set first. Or you can just create a new file named "build.xml", the Ant Editor will be the default editor for that file.
There's a basic tutorial which introduces several concepts in Ant and Eclipse, such as ant configurations, ant view, etc. It's available in http://individual.utoronto.ca/kia/ .
Another article from onJava.com: Integrating Ant with Eclipse .
Link from Eclipse online help on this topic: Eclipse Help about Ant .
Sometimes you need to prepare the MANIFEST.MF file to deploy your programs, a tutorial about this is available in Packaging Programs in JAR Files .

Eclipse tricks

1. After setting up the default comment, sometimes you find it does not take effect. The solution to this is to select Window --> Preferences --> Java --> Code Style, and tick "Automatically add comments for new methods and types".
2. When you install eclipse plugins to measure software metrics, you need to enable it first in the Property page of the project.
3. When you want to update your JRE from 1.4 to 1.5 in Eclipse, just modify Window --> Preferences --> Java --> Build Path does not suffice. You also need to modify Window --> Preferences --> Java --> compiler to make it compatible with Java 5.0.

JUnit, it's all about testing

Writing test code sometimes is very annoying for programmers. Many experienced developers turn to a testing framework like JUnit. I read several article about JUnit today, and picked some useful ones to list below:
JUnit Test Infected: Programmers Love Writing Tests , and it's from the JUnit website. I believe it's one of the first articles that teach people about JUnit framework.
Eclipse fans like me can use the following sources:
Using JUnit with Eclipse IDE, it's from http://www.onjava.com .
JUnit Test Tutorial from File systems and Storage Lab (FSL) of CS Department, Stony Brook University.
Unit Testing in Eclipse Using JUnit, from CS Department of North Carolina State University.

Some key points:
Different kinds of tests include:
Unit tests: to check the correctness of several modules (classes).
Customer's tests: functional, system and acceptance tests. All these tests check the behavior of the system as whole. In the XP methodology, these tests are written by the customer, given the program skeleton.
Integration tests: to help test the interaction of several levels of the application.
Developer tests: tests used by developers to verify the whole code, new pieces of code and/or new functions.
JUnit is very useful when dealing with developer's test.

Monday, August 07, 2006

How to calculate execution time

Execution time is a very important measure to evaluate the system performance. The execution time can be computed by reduce the ending time using the starting time of the program.
But how to get the starting and ending time?
I'm used to imagine a solution and check it in Java API. So it's very natural for me to consider the Date class. But unfortunately, Date does not provide a static method for us to get the current time. So I have to create a new Date object whenever I want to retrieve the point of time. I've always been very curious about why Java does not provide a static method.
Today, I happened to find another method to get such a time in a book. The System object has a static method called currentTimeMillis(), which returns the current system time. I finally realize that I have used the previous stupid method for so long!

Thursday, August 03, 2006

Thread pool, J2SE 5's new feature

I just implemented a route searching engine who's able to figure out the shortest path in a maze. As there are thousands of threads running in the program, a thread pool might be a good choice. Thread pool is a new feature of J2SE 5. In my opinion, it's a much better feature than CachedRowSet, which is also a new feature in J2SE5 advertised by SUN.
A thread pool can be acquired by using the following statement:
ExecutorServer threadPool = Executors.newFixedThreadPool(1000);
Then, use threadPool to execute threads:
threadPool.execute(seekerThread1);
I compared 2 implementations using JRE 1.4 and JRE 1.5. The one using thread pool is much more efficient than the one without using thread pool. Maybe it's especially useful for application with a lot of threading work.

Wednesday, August 02, 2006

Apache Tomcat Developer's Guide

Source: http://tomcat.apache.org/tomcat-4.1-doc/appdev/index.html

Standard Directory Layout
root/ -- .html, .jsp files
--- WEB-INF/ -- web.xml
--- classes/ -- .class files
--- lib/ -- .jar files as library

Setup of Ant and Tomcat for Development


  • Configure the Ant custom tasks: The implementation code for the Ant custom tasks is in a JAR file named $CATALINA_HOME/server/lib/catalina-ant.jar. This file must be copied into the lib directory of your Ant installation.
  • Define one or more Tomcat users. --> Use the Manager web application, only user that has the security role manager can login. Tomcat users and roles are specified in a "database" called a Realm. The realm defines the interface between a servlet container and the associated user and role information. Tomcat4 defines a Java interface org.apache.catalina.Realm that can be implemented by "plug in" components to establish the connection between a servlet container and some existing authentication database or mechanism that already exists in the production environment. There are 4 ways to access different sources of authentication information: DataSourceRealm, JDBCRealm, JNDIRealm, and MemoryRealm ($CATALINA_HOME/conf/tomcat-users.xml). Source: http://tomcat.apache.org/tomcat-4.1-doc/realm-howto.html .


Create Project Source Code Directory
mkdir myapp
cd myapp
mkdir docs
mkdir src
mkdir web
cd web
mkdir WEB-INF
cd ..
cvs import -m "Initial Project Creation" myapp myapp start
This set of commands creates the project directory, and defines it within your CVS repository. In the last line, the "Initial Project Creation" is a log message, the first myapp specifies the directory $CVSROOT/myapp to store the project file. The second myapp is a vendor tag, and the start is a release tag. These tags may fill no purpose in this context, but cvs requires them to be present.
The doc directory contains static documentation files to be copied to the docs sub-directory of the distribution. The src directory contains the Java source code to be compiled to the WEB-INF/classes sub-directory of the web application. The web directory contains static web page files.
Later, the project can be exported from the cvs directory using command:
cvs checkout myapp
When some modifications are made to the project files, these changes can be done on the repository using commands like this:
cvs add build.xml
cvs commit
The changes are local to your own development directory until you perform the commit.

Customize Project Properties
The customization is done by creating a file named build.properties in the project's top-level directory. The supported properties are listed in the build.xml file. A sample of this file can be got from this link. At a minimum, you will generally need to define the catalina.home property defining where Tomcat4 is installed, and the manager application username and password. You might end up with something like this:
# Context path to install this application on
app.path=/myapp
# Tomcat4 installation directory
catalina.home=C:\\local\\jakarta-tomcat-4.1.31
# Manager webapp username and password
manager.username=tomcat
manager.password=tomcat
In general, you will NOT want to check the build.properties file in to the CVS repository, because it is unique to each developer's environment. Note the DOUBLE slash in the fourth line, because the catalina.home variable is referenced as string in the build.xml file.

Describe the Web Application
A sample web descriptor can be found here.
cvs add web.xml
cvs commit

Edit Source Code and Pages
Whenever you wish to refresh your development directory to reflect the work performed by other developers, you can use the following cvs commands:
cd myapp
cvs update -dP
The commands to add new files to the repository are already listed above.

Build the Web Application
The Ant tool executes the default "compile" target in the build.xml file, which will compile any new or updated Java code.
cd myapp
ant
To force the recompilation of the entire application, do this:
cd myapp
ant all

Test the Web Application
The quickest way to test the application is to use the custom Ant tasks that are included in the sample build.xml script.
Compile the application: use ant compile or ant (default).
Install the application: use ant install command. This tells Tomcat to immediately start running your application on the context path defined in app.path build property. Tomcat does NOT have to be restarted for this to take effect.
Test the application: use the browser or other testing tools to test the functionality of the application.
Modify and rebuild as needed: when you discover that some changes are required, make those changes in the original source files, not in the output build directory, and reissue the ant compile command. This ensures that your changes will be available to be saved later on, and the output build directory is deleted and recreated as necessary.
Reload the application: Tomcat will recognize changes in JSP pages automatically, but it will continue to use the old versions of any servlet or JavaBean classes until the application is reloaded. You can trigger this by executing the ant reload command.
Remove the application: you can use the ant remove command.
Check the applications: you can use the ant list command to list all the applications deployed on the server.

Creating a Release
Finally, it is time to create the distributed version of your web application that can be deployed on the production server. The following general steps are required:
(1) Issue the command ant all from the project source directory, to rebuild everything from scratch one last time.
(2) Use the cvs tag command to create an identifier for all of the source files utilized to create this release. This allows you to reliably reconstruct a release at a later time.
(3) Issue the command ant dist to create a distributable web application archive (WAR) file, as well as a JAR file containing the corresponding source code.
(4) Package the contents of the dist directory using the tar or zip utility, accroding to the standard release procedures.

Additional Information about CVS
cvs can access a repository by a variety of means. In order to distinguish various ways to access a repository, the repository name can start with an access method. The access method :local: means to access a repository directory. In Unix system, if the repository starts with '/', then :local: is assumed. Otherwise, either :ext: or :server: is assumed. But in Windows OS, you must specify the access method, like :local:C:/local/cvsroot.
To create a repository under windows, we can use:
cvs -d :local:C:/local/cvsroot/ init
Access Remote Repositories
The format for the name of the remote repository is:
[:method:][[user][:password]@]hostname[:[port]]/remote_path