Calling The Cfx From A Coldfusion Template; Zipbrowser Example - MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual

Developing web applications with coldfusion
Table of Contents

Advertisement

284
your
CustomTag
instances of your

Calling the CFX from a ColdFusion Template

You call Java CFXs from within ColdFusion templates by using the name of the CFX.
The following CFML template calls the
<HTML>
<BODY>
4
<CFX_HelloColdFusion NAME="Les">
</BODY>
</HTML>
To test the CFX
1.
Create a new source file in your editor and enter the code displayed above.
2.
Save the file in a directory configured to serve ColdFusion templates. For example,
you might save the file as
Windows NT or
3.
Request the template from your web browser using the appropriate URL, for
example
http://localhost/cfdocs/testjavacfx.cfm
ColdFusion processes the template and returns a page that displays the text "Hello,
Robert." If an error is returned instead, check the source code to make sure you have
entered it correctly.

ZipBrowser Example

The following example illustrates the use of the
The example uses the
ZipBrowser,
The fully qualified path of the zip archive to browse is specified using the
attribute. The name of the query to return to the calling page is specified using the
attribute. The query returned contains three columns: Name, Size, and
NAME
Compressed.
For example, to query an archive at the path
output the results you would use the following CFML code:
<CFX_ZipBrowser
ARCHIVE="c:\logfiles.zip"
NAME="LogFiles" >
<CFOUTPUT QUERY="LogFiles">
#Name#,
</CFOUTPUT>
object. If you wish to store data and/or objects that are accessible to all
you should use static data members.
CustomTag
:
c:\inetpub\wwwroot\cfdocs\testjavacfx.cfm
/home/docroot/cfdocs/testjavacfx.cfm
java.util.zip
which is a zip file browsing tag.
#Size#, #Compressed# <BR>
Developing Web Applications with ColdFusion
custom tag:
HelloColdFusion
on UNIX.
,
Request
Response
package to implement a Java CFX called
c:\logfiles.zip
on
, and
objects.
Query
ARCHIVE
for its contents and to

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents