Home > Store

Java for ColdFusion Developers

Register your product to gain access to bonus material or receive a coupon.

Java for ColdFusion Developers

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 2003
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-046180-6
  • ISBN-13: 978-0-13-046180-3

The first Java guide specifically for experienced ColdFusion developers and Web professionals!

  • Leverage your Web and ColdFusion skills to develop powerful Java applications
  • Master JSP, servlets, custom tags, JavaBeans, JDBC, and other key Java Web technologies
  • Install and run Apache Tomcat 4 and JRun 4 application servers
  • Build several complete applications, including an e-commerce site
  • Includes handy Java glossary and JSP/servlet references
  • Up-to-the-minute coverage of Java 1.4, JSP 1.2, servlet 2.3, and ColdFusion MX

With ColdFusion MX and this book, any Web professional can leverage the power of Java to build robust, high-performance Web applications. Leading Web developer and columnist Eben Hewitt begins with a rapid-fire introduction to Java that builds on what you already know about ColdFusion to teach you exactly what you need to know about Java programming. Hewitt's focused examples, real-world insights, and code will take you from the basics of object-oriented programming to sophisticated JSP/servlet development, XML-based applications, and beyond!

  • Master object-oriented application design and programming
  • Build powerful servlets, JavaServer Pages, applets, and desktop applications
  • Leverage XML & XSLT, exception handling, I/O, JDBC databases, and more
  • Understand the similarities and key differences between CFML and Java development
  • Integrate ColdFusion MX with J2EE and servlet technology
  • Create JSP custom tags and use the brand-new JSP Standard Tag Library
  • Includes complete references to JSP tags and the Servlet API, plus a handy Java glossary

The bookÕs extensive code examples (downloadable from www.corecoldfusion.com) include a start-to-finish Java e-commerce application.

Sample Content

Online Sample Chapter

Java Objects and Classes in ColdFusion

Table of Contents



Foreword.


Acknowledgments.


1. Introduction.

Why Java for ColdFusion Developers? Who This Book Is For. What This Book Is Not. Overview of Book Sections.



2. Java Jump Start.

The New ColdFusion Architecture. Benefits of Moving to the Java Technology Platform. The Java Platform. Gathering Your Tools. Anatomy of a Simple Java Program. Understanding the API. Exercise 1: Download and Install the SDK. Exercise 2: Using the API Documentation.



3. Java Data Structures.

Binary Overview. Data Types in ColdFusion. Data Types in Java. Primitive Data Types. Variable Assignment and Initialization. Operators. Overflow. Operator Precedence. Casts and Conversions. Java Standard Classes. What's Next.



4. Programming Structures.

Wrapper Classes. Strings. Loops. Arrays. Conditional Logic. Example Program: CheckerBoard.java. Example Program: Debt Calculator. Command Line Input. Using Methods: Toward Object-Oriented Programming. Visibility. Composition of the main Method. What's Next?



5. Object-Oriented Application Design.

Objects. Why Software Projects Fail. Software Development Processes. Case Study: Bookstore. Introduction to OOAD. Use Cases. Creating UML Diagrams. Class Diagrams. User Scenarios and Use-Case Diagrams. Collaboration Diagrams. Sequence Diagrams. Package Diagrams. Encapsulation. Inheritance. Software and Hollywood Movies. What's Next?



6. IDEs.

Macromedia Editor Changes and Java IDEs. Projects. Dreamweaver MX. Sun ONE Studio 3 (Forte for Java). Jbuilder. IntelliJ IDEA. Putting Your IDE to Work. What's Next.



7. Objects and Classes.

Packages. Documentation with JavaDoc. Field Defaults and Field Initializers. Polymorphism. Constructors. static Methods. The this Reference. Stack and Heap Memory. Putting Things Together. What's Next.



8. Exceptions.

Exceptions. What's Next.



9. Advanced Object-Oriented Concepts.

Inner Classes. Inheritance. Abstract Classes and Abstract Methods. Interfaces. Final. Reflection. What's Next?



10. Extending ColdFusion with Java.

Configure ColdFusion Server Settings for Java. Using <cfobject>. CFX Custom Tags. Applets. Using Applets with <cfapplet>. Working with Browsers and the Java Plugin. Swing and AWT. What's Next?



11. Collections and Regular Expressions.

Synchronization and <cflock>. ColdFusion Structures. Collections Overview. General Collections Methods. Collections Interfaces. Collection Classes. Lists. Sets. Maps. Using Regular Expressions. What's Next.



12. JDBC.

Using JDBC. Metadata. Transactions. Stored Procedures. Example GUI Application: Database Query Viewer. What's Next.



13. Servlets and CFMX/ J2EE Integration.

Using Java Technology to Create Web Sites. Compare ColdFusion and Java Web Technologies. ColdFusion MX J2EE Capabilities. Java Web Servers. Installing Tomcat. Configuring JSP Web Applications. Creating a Tomcat Web Application Manually. Servlets. A Database-Driven Authentication Servlet. ColdFusion MX and J2EE Integration. Configuring MySQL Database Server. What's Next? 436.



14. JavaServer Pages.

Overview of JSP. Scripting Elements. Directives. Actions. Model-View-Controller. Implicit Objects. Error Pages. JavaBeans. Sample Bean Application: Writing Dynamic XML. What's Next?



15. JSP Custom Tags.

Getting Started with Custom Tags. Writing a Simple Custom Tag. Importing a JSP Library in CFMX. Working with the JSTL. The web.xml File. JSP Satellite Developments. What's Next?



16. J2EE Case Study: An E-commerce Site.

Application Overview. Database. Setup. Root Application Files. Styles. WEB-INF. WEB-INF/classes/com/cybertrails/store. WEB-INF/classes/com/cybertrails/store/beans. WEB-INF/classes/com/cybertrails/store/tags. WEB-INF/classes/com/cybertrails/admin. WEB-INF/lib. WEB-INF/jstl10. What's Next?



Appendix A. JSP 1.2 Reference.

Comments. Directives. Standard Actions.



Appendix B. API Reference.

javax.servlet Interfaces, Classes, and Exceptions. JSP API for javax.servlet.jsp and java.servlet.jsp.tagext. javax.servlet. javax.servlet.http Interfaces and Classes.



Appendix C. Glossary of Terms.


Appendix D. Java Bookmarks.

General Java. JSP and Servlets.



Appendix E. Quick Reference.

Checking Environment Variables. Setting CLASSPATH. Setting JAVA_HOME. Setting the PATH. Checking Current Version. Compiling and Running Programs. Primitive Data Types. Declaring and Initializing Variables. Class Definition. Constructors. Declaring Methods. Calling Methods. Overloading Methods. Overriding Methods. Package. Import. Inheritance. Defining and Implementing an Interface. Exceptions. Creating a .jar File. Creating the Proper Directory Structure for a Web Application. The Simplest Possible web.xml File. Creating a .war File.



Index.

Preface

Foreword

Well, someone has finally dared to use the J-word in a book written for the ColdFusion developer community. I couldn’t be happier! Eben Hewitt has written a book about Java for ColdFusion developers—and it’s an excellent book, I’m happy to report.

But wait—Java? Hasn’t Macromedia spent a great deal of effort reassuring ColdFusion developers that they won’t need to learn Java to use ColdFusion? They certainly have—and when the question is phrased as “Must I learn Java?,” the answer must be “No.” But perhaps our question ought to be, “Should I learn Java?” Ask a better question and you may get a better answer.

There are any number of very practical reasons that you might want to learn Java. That you’re holding this book in your hands rather than another indicates that you’re probably well aware of them. For many of us, the most compelling reasons are the increased job opportunities and better pay that knowing Java represents.

Like it or not, we developers work in a field where our current knowledge has a finite lifetime of usefulness. In the hyper-accelerated environment of Web technology, new knowledge springs forth daily to replace the old. Our hard-won expertise becomes less valuable daily. Economists even have a term for this; they call it a wasting asset. Ouch.

The inescapable fact is that this new knowledge mainly centers on Java, and that fact can be a terrifying one to ColdFusion programmers, who might ask, “Java? You want me to learn Java—with all its weird, C-like syntax and classes that extend from this and inherit that and are dependent on something else? That Java?”

Yes—that Java. Java represents a watershed event in the history of software development—the mass adoption of object orientation (OO) as the standard for building software. For 30 years, OO has been being nurtured in a community of dedicated academicians, theorists, and tool-builders.

Building on the best practices that proceeded it, OO provides not only some new languages (e.g., Eiffel, Smalltalk, and Java), but a new way of approaching how we create software. During my career, OO has moved from being a quirky, ivory-tower science project to the dominant paradigm for building commercial software. And Java stands as the unchallenged 800-pound gorilla of OO languages.

Financial considerations aside, I find that developers are very creative people who enjoy the thrill of making scale-modeled universes that work! Java represents a new set of tools that can help you built bigger, better, cooler (and yes, more profitable) universes. Learning Java will almost certainly make you a more capable and more secure developer. And, while you don’t have to learn Java to continue to use ColdFusion, the new capabilities of ColdFusion MX make learning Java more attractive than ever.

All right; you’ve decided to take the plunge. If Java is the future, you’re ready to embrace it. Why this book, though? There’s certainly no shortage of Java books around. Some are bigger, some are cheaper, some even have a snazzier cover! Or does it even matter? Having made the decision to learn Java, does the choice of book really make much of a difference?

I believe it does. Learning a new language is not easy. Consider the difficulties encountered for centuries by Egyptologists trying to decipher the picture-language used by ancient Egyptians. Scholars had expended great efforts only to achieve scant results. Then, in 1799, some of Napoleon’s soldiers were digging the foundations of an addition to a fort near the town of Rashid in the Nile delta when they came across a six-foot tall stone with hieroglyphs on it.

Had that been all there was to the stone, very little consideration would have been given to it. It dated from about 195 B.C., but such ancient artifacts endowed with hieroglyphs were neither rare nor notable in the Nile valley. The text of the stone was not particularly noteworthy, either. It began with the praises of King Ptolemy V, it was followed by an account of the siege of the city, Lycopolis, and it ended with the establishment of a religion venerating the king. But, today, every schoolchild knows of this stone, which became known as the Rosetta stone. What made this stone special was the fact that the text was inscribed in both the unknown Egyptian hieroglyphs and the familiar Greek language. The scholars’ knowledge of Greek thus became a key to learning an unknown language.

You might think of this book as a type of Rosetta stone—one that will help you to decipher Java. It begins with what you know—ColdFusion—and uses this as a key to help you understand Java. I can think of no better way to learn a new language.

Building on this excellent idea, Eben uses clear language, copious examples, insightful theory, and wry humor to achieve his goal—helping us leverage our ColdFusion knowledge into Java expertise.

This book won’t teach you everything about Java. No book can. As a friend of mine says, “Saying ‘I know Java’ is like saying, ‘I know science.’” There’s plenty of material to work with for years to come. But this book will give you a working knowledge of Java basics and a firm foundation on which to increase your knowledge. If you’re a ColdFusion programmer looking to learn Java, I can offer no better advice than to buy this book and study it.

—Hal Helms

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020