advertisement
javaboutique
Search Tips
Articles  |   Tutorials  |   Reviews  |   Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source  |   Forums  |  
javaboutique
Browse DevX


Partners & Affiliates











advertisement



Title: JSP Tag Libraries
ISBN: 193011009X
US Price: $35.96
Publication Date: May 2001
Pages: 656
© 2001 Manning Publications Co.

Reviews : Java Books :
JSP Tag Libraries : Chapter 3: Developing your first tags

3. 3 Setting up a development environment

Before we can build our first tag, we need to configure our development environ-ment. This development environment should at least make it possible to:

  • Compile the tags with the servlet, JSP, and JSP custom tags API 1
  • Test the developed tags
  • Browse the JSP custom tags API documentation.

1 We will take a look at the JSP custom tag API in chapter 4.

There are several Java IDEs in today's market, some of which provide fine support for servlet and JSP development; however, we are not going to work with any par-ticular IDE because it is highly unlikely that you would have the same one that we select. Also, IDEs are notorious for lagging behind the leading edge of the Servlet and JSP API. Instead we explain how to fetch all the ingredients for a minimal devel-opment environment and how to set them up so that you may start developing tags immediately. This development environment will be concentrated around Tomcat, 2 the reference implementation of the servlet API, and the JDK1.2.2 or above (as available to most operating systems).

3.3.1 Installing the JDK

The first step in setting up the development environment is to install JDK1.2.2 (or higher) on your development system. More than two years since its first appearance, JDK1. 2 can be found in a matured state on most operating systems, and this book uses many of its new classes and interfaces, such as java.util.Iterator. Although JDK1.2 is recommended for tag development, a JDK1.1. x version should suffice. Installing the JDK is an operating system-dependent task and will not be covered here, so we'll assume that you have a JDK installed and that you point into the installation directory with an environment variable named JAVA_HOME.

3.3.2 Installing Tomcat Tomcat is the reference implementation of the Servlet and JSP API. It is easy to use and install, has a very small footprint (both on the hard drive and in memory), and is Open Source— all of which makes it a perfect learning tool. Installing Tomcat with the basic functionality of a stand-alone servlet and JSP container is really a cinch:

  • Extract the Tomcat binary distribution archive 3 (available as either .zip or tar.gz archives).

  • Define an environment variable named TOMCAT_HOME to point to Tomcat's installation root directory.

  • Make sure that the environment variable JAVA_HOME is defined and points to the directory wherein you installed your JDK.


2 Tomcat's home on the web is at http://www/jakarta.apache.org

3 You can download the binary distribution directly from Tomcat's web site. The installation directives supplied in this book apply to Tomcat versions 3.1 and 3.2.

3.3.3 Testing your Tomcat installation

To test-drive Tomcat, change the directory to TOMCAT_HOME and execute the startup script in Tomcat's bin directory. Tomcat should start running in the back-ground and you can test it by issuing an HTTP request (i.e., http://your.machine.name:8080/). Once Tomcat is running, the installation of the development environment is complete and you may start immediately to develop tags; but first, let's look at the Tomcat distribution.

servlet. jar
The .jar file is where you find the interfaces and classes constituting the Servlet and JSP API. This file is named servlet. jar and is located in Tomcat's Lib directory. When compiling a servlet or JSP custom tag, you should make sure that this file is in your compilation CLASSPATH definition.

webapps directory
Where to place your web applications for Tomcat is the next consideration. Tomcat can generally be configured to take applications from any place you choose, but why bother configuring individual applications when you can simply drop your application into a single directory for deployment? The one directory approach will prove much simpler for your first applications. Under TOMCAT_HOME there is a subdirectory named webapps; and whenever Tomcat starts to run, it inspects this subdirectory, searches for web-application archive files (.war), and automatically deploys them. Moreover, if Tomcat finds subdirectories under webapps, it will assume that these directories contain web applications. Deployment to this direc-tory is thus a simple task.

Javadoc documentation
One last thing to consider with Tomcat is the location of the Javadoc documents for the Servlet and JSP API. These documents are located in an application bundled with the Tomcat samples. In the webapps directory, there's a directory named ROOT, the home of Tomcat default root application. The root application has a subdirectory path named docs/api where you can find the Javadoc documents for the Servlet and JSP API (start with the file index.html). 4 With the environment configured and a basic understanding of the deployment picture, it's time to build our first custom tag.


4 You can also browse these documents by starting Tomcat and referring to http://your.ma-chine.name: 8080/docs/api/index.html.
Stop by in one week for the next installment!

How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.

 Intel Go Parallel Portal
 Internet.com eBook Library
 IBM Software Construction Toolbox
 Microsoft RIA Development Center
 Destination .NET
XML error: not well-formed (invalid token) at line 43
advertisement
Receive Articles via our XML/RSS feed
Receive Articles via our XML/RSS feed

JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.

Google Hopes Chrome Will Help, Not Hurt Firefox
Remember Figlets? They're Back With Zend
Microsoft Readies an App Store Competitor?
Google: Chrome Browser Will Make Money
Sam Ramji: Microsoft's Man in Open Source
Google to Shake Up Browsers With Own Launch
Mozilla's Ubquity Mashup: For The Masses?
iPhone Users Just Want to Have Fun
Oops! I Fixed the Linux Kernel
Jim Zemlin: The New Center of Linux Gravity

Code Around C#'s Using Statement to Release Unmanaged Resources
Writing Functional Code with RDFa
BitLocker Brings Encryption to Windows Server 2008
Network Know-How: Exploring Network Algorithms
Create a Durable and Reliable WCF Service with MSMQ 4.0
The Baker's Dozen: 13 Tips for SQL Server 2008 and SSRS 2008
Book Excerpt: Microsoft Expression Blend Unleashed
Develop a Mobile RSS Feed the Easy Way
State of the Semantic Web: Know Where to Look
A 3D Exploration of the HTML Canvas Element

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Intel PDF: Virtualization Delivers Data Center Efficiency
Intel eBook: Managing the Evolving Data Center
Microsoft Article: BitLocker Brings Encryption to Windows Server 2008
Symantec eBook: The Guide to E-Mail Archiving and Management
Microsoft Article: RODCs Transform Branch Office Security
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
Avaya Article: Advancing the State of the Art in Customer Service
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Avaya Article: Avaya AE Services Provide Rapid Telephony Integration with Facebook
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Seminar: Efficiencies in Hardware/Software Virtualization
HP Webcast: Disaster Recovery Planning
Go Parallel Video: Performance and Threading Tools for Game Developers
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
IBM TCO eKIT: Your IT Budget is Under Attack, Get in Control
IBM Energy Efficiency eKIT: Learn How to Reduce Costs
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Microsoft Article: Silverlight Streaming--Free Video Hosting for All
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
HP Demo: StorageWorks EVA4400
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES