Chapter 10. Extending ColdFusion with Java

   

You now have much of the basic knowledge required to write Java programs of any complexity. A good portion of the remainder of your work is to become as familiar with the API as you can. The concepts you already know regarding classes and objects and OOP principles are all you need to understand the API and implement it. Classes relate hierarchically to make objects that hold data and define operations. That is it.

The principles are the same whether you're using a JPanel object or an Employee object or a String object. So in order to begin programming more complex applications, the main thing to do is dive into the API and find out what is available and start working with different items, applying and exercising the principles you already know.

In this chapter, we cover how to use Java extensions to your ColdFusion environment. There is a lot you can start doing now to leverage the capabilities of Java from within ColdFusion MX and earlier versions. Here we will look at using the <cfobject> tag to invoke Java objects directly from within a ColdFusion template. We will cover incorporating Java applets into your ColdFusion templates and writing CFX custom tags that allow you to invoke compiled Java classes as custom tags.

In ColdFusion MX, <cfservlet> and <cfservletparam> , which have been used to invoke JRun servlets, are now deprecated owing to the integration between these products.

We will discuss servlets and JSPs in later chapters, and determining how to invoke them from ColdFusion is a topic more appropriate there. In the chapter devoted to writing custom tags (also known as custom actions) in JSP, we will also discuss another way of extending ColdFusion with Java: the ColdFusion tag introduced in CFMX, <cfimport> .

This chapter represents the only real ColdFusion usage we will cover in this book, as it is assumed that you know ColdFusion rather well. However, even many advanced ColdFusion developers have little or no experience with using Java from within ColdFusion, which is the reason it is covered here.

Note

This chapter assumes that you have ColdFusion MX installed and running. You can download a 30-day free trial version from www.macromedia.com. After the 30 days is expired , the server automatically converts to a single-IP development version. You may use the development version indefinitely, but only localhost can send requests to ColdFusion.



   
Top


Java for ColdFusion Developers
Java for ColdFusion Developers
ISBN: 0130461806
EAN: 2147483647
Year: 2005
Pages: 206
Authors: Eben Hewitt

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net