Apache Jakarta Commons: Reusable Java Components

Apache Jakarta Commons: Reusable Java Components

by Will Iverson
     
 

  • Easy-to-follow coverage of twelve indispensable Jakarta Commons packages

  • Code examples that show innovative uses of Commons components, including using HttpClient to access Web resources, FileUpload for handling HTTP file uploads, and BeanUtils for easy form generation

  • Detailed instructions for combining the Commons project libraries with the

Overview

  • Easy-to-follow coverage of twelve indispensable Jakarta Commons packages

  • Code examples that show innovative uses of Commons components, including using HttpClient to access Web resources, FileUpload for handling HTTP file uploads, and BeanUtils for easy form generation

  • Detailed instructions for combining the Commons project libraries with the popular Eclipse IDE

Save time and money with reusable open source Java™ components

Master the Jakarta Commons Library of Open Source JavaTM Components

Using the Apache Jakarta Commons reusable Java™ components, you can leverage the work of the global open-source community to solve common programming problems reliably, quickly, and inexpensively. But, to use the Commons libraries effectively, you need far more guidance than the official documentation offers. In Apache Jakarta Commons: Reusable Java™ Components, Will Iverson covers what Java developers need to know to take full advantage of Jakarta Commons—starting right now.

Iverson begins with a definitive overview of the Commons project: goals, installation, and getting started with Commons components. Next, he presents example-rich chapters on the twelve most useful Commons packages, covering topics ranging from HTTP FileUpload to database connectivity. Iverson provides detailed code samples for every component he describes. After you've mastered the core Jakarta Commons packages, you'll constantly rely on this book's handy seventy-five page quick-reference. Iverson's coverage includes

  • Downloading Commons project libraries and installing them into Eclipse

  • Programmatically accessing resourcesvia HTTP, FTP, NNTP, and other Internet protocols

  • Using the Jakarta Commons suite of configurable object pools

  • Managing database connectivity in Swing applications—and anywhere containers aren't doing it for you

  • Using BeanUtils to generate forms and gain runtime access to information provided by JavaBeans-style objects

  • Traversing complex object graphs with JXPath

  • Using Jakarta Commons' advanced collections tools to establish richer object relationships

  • Extending java.lang with better methods for manipulating core classes

  • Implementing conversion routines, configurable logging, command-line help, and more

  • Exploring the newest packages, including emerging "sandbox" packages

Whether you're building code for front-end Web applications, client-side software, or back-end servers, learning Jakarta Commons will make you far more efficient. Apache Jakarta Commons is the fastest way to master and get results with Commons.

About the Web Site

All of the book's sample Java programs are available for download from: http://www.cascadetg.com/commons/.

© Copyright Pearson Education. All rights reserved.

Product Details

ISBN-13:
9780131478305
Publisher:
Prentice Hall Professional Technical Reference
Publication date:
02/11/2005
Series:
Bruce Perens' Open Source Series
Pages:
338
Product dimensions:
6.88(w) x 9.20(h) x 0.89(d)

Read an Excerpt

PrefacePreface

I originally noticed the Jakarta Commons libraries while working with Apache Jakarta Tomcat. At some point, Tomcat started to include a suite of small libraries with commons in the name. They started to show up everywhere, in all sorts of other open source projects. At first, it was slightly off-putting—what exactly is commons-lang.jar, and why is this tiny library showing up in all of my software?

Exploring the Jakarta Commons, I first found a broad suite of what I would characterize as "utility" code—things that often wound up in my software in packages named things like "util." Digging deeper, I found useful libraries to solve common problems, interesting algorithms, and more. In brief, by using the Jakarta Commons, I found I spent less time reinventing the wheel, and more time solving the problem at hand.

Virtually every Java developer can take advantage of various Jakarta Commons components—from the utilities provided by the Collections and Lang packages, through the networking components afforded by the HttpClient and Net packages. These components underlie Apache Tomcat, Struts, and countless other projects, helping move forward both the Java industry and the Java platform.

The first few chapters cover the more web-specific packages, including FileUpload, HttpClient, and the Net suite of protocol implementations. The Pool and DBCP packages are useful for a broader range of applications. BeanUtils and JXPath provide easier ways to work with objects. Logging, Lang, and Collections are a suite of tools applicable to almost every application. Codec provides a suite of specialized conversion routines, useful for datatransfer, security, and (interestingly) phonetic analysis. Finally, the CLI package provides support for building command-line applications.Chapter 1: Overview

This chapter shows you where to download the various Commons components, and also how to install both the libraries and the documentation into Eclipse.Chapter 2: FileUpload

This chapter shows how to easily add file upload capabilities to your web application.Chapter 3: HttpClient

This chapter shows how to programmatically access HTTP resources. HttpClient provides many features, including cookie management and support for a broad range of features. Chapter 4: Net

This chapter shows how a wide variety of common Internet protocols can be accessed, including FTP, NNTP, and others.Chapter 5: Pool

This chapter demonstrates the use of a suite of configurable object pools.Chapter 6: DBCP (Database Connection Pool)

This chapter covers the DBCP package, useful for Swing applications and other situations in which a container is not managing database connectivity for you.Chapter 7: BeanUtils

This chapter shows how the information provided by JavaBeans-style objects can easily be accessed at run-time.Chapter 8: JXPath

As you build applications composed of complex graphs of objects, traversing those objects can become tedious. JXPath provides an easy mechanism for walking through these graphs.Chapter 9: Logging

Virtually every application can benefit from configurable logging—and the logging package is a good place to get started.Chapter 10: Lang

Lang is one of the most useful packages, but one of the hardest to get started with. This chapter provides an overview of the Lang package, helping you get oriented.Chapter 11: Collections

This chapter covers powerful tools for working with collections—richer object relationships.Chapter 12: Codec

This chapter shows how to use a suite of specialized conversion routines useful for data transfer, security, and phonetic analysis.Chapter 13: CLI (Command-Line Interface)

Learn how to present consistent, useful command-line configuration and help information—with a bonus class path search tool.Chapter 14: Other Projects

This chapter provides a roadmap for a broad suite of other Commons projects—both the proper and sandbox.Downloading the Code

The code presented in this book is available for download from http://www.cascadetg.com/commons/.

© Copyright Pearson Education. All rights reserved.

Meet the Author

About the Author

Will Iverson has been working in the computer and information technology field professionally since 1990. His diverse background includes developing statistical applications to analyze data from the NASA Space Shuttle, product management for Apple Computer, and developer relations for Symantec's VisualCafé. For nearly five years, Will ran an independent J2EE consulting company with a variety of clients including Sun, BEA, and Canal+ Technologies. He currently serves as the application development practice manager for SolutionsIQ. Will lives in Seattle, Washington.

© Copyright Pearson Education. All rights reserved.

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >