RE: Learning CFX

2001-07-16 Thread Pete Freitag

That is correct, the CFX API is somewhat limited.  I think in NEO, the we
will have all the features of the JSP Custom Tag Spec (Parent/Child tags,
BodyContent, StartTag, EndTag).

Basically all you can do with the CFX API is...

Read in a query or a string (The com.allaire.cfx.Request Object)

Run your code

Output a string variable, or query (Using the com.allaire.cfx.Response
object), or output directly to the page output buffer.

This all takes place within the processRequest(Request, Response) method.
In order for a Java class to be
a CFX Custom Tag, it must implement the com.allaire.cfx.CustomTag interface.
An interface is basically a bunch of methods that a class MUST have.  In the
CustomTag interface the only method you MUST have is the processRequest()
method.

So that's basically what you need to know to make a CFX tag.  You can
consult the JavaDocs for the specific methods for each of the objects, some
of the common ones are...

String Request.getAttribute("attributeName")
boolean Request.attributeExists("attributeName")

void Response.write("Write output")
void Response.setVariable("varName", "value")

So here's a quick example:

import com.allaire.*;

public class CFX_Example
implements CustomTag
{
public void processRequest(Request request, Response response)
throws Exception
{
if (request.attributeExists("MYNAME"))
{
String myname = request.getAttribute("MYNAME");
response.write("My name is: " + myname);
}
}


}

now in cf...



Will output:

My name is: pete



Pete Freitag ([EMAIL PROTECTED])
CFDEV.COM
ColdFusion Developers Resources
http://www.cfdev.com/


-Original Message-
From: Bryan LaPlante [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 16, 2001 8:27 AM
To: CF-Talk
Subject: Re: Learning CFX


Thank you sir. I am finding that either there docs are really poor or cfx
tags have know way of knowing what is going on in the page. There seems to
be no access to any variable scope like application, session, client and so
on

- Original Message -
From: "Paul Mone" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, July 16, 2001 7:24 AM
Subject: RE: Learning CFX


| Bryan,
| FYI, ColdFusion v5.0 comes with 5 java CFX examples in
| \CFUSION\cfx\java\distrib\examples\
|
|
| ---
| Paul Mone
| Ninthlink Consulting Group
| [EMAIL PROTECTED]
| http://www.ninthlink.com
| 619.222.7082
|
|
| -Original Message-
| From: Bryan LaPlante [mailto:[EMAIL PROTECTED]]
| Sent: Monday, July 16, 2001 4:57 AM
| To: CF-Talk
| Subject: Learning CFX
|
|
| I am learning to write cfx tag in Java. If anyone is aware of open source
| tags that I can learn from I would like to download them.
|
| Thanks
|
| Bryan LaPlante
| 816-347-8220
| [EMAIL PROTECTED]
| http://www.netwebapps.com
| Web Development
|
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Learning CFX

2001-07-16 Thread Bryan LaPlante

Thank you sir. I am finding that either there docs are really poor or cfx
tags have know way of knowing what is going on in the page. There seems to
be no access to any variable scope like application, session, client and so
on

- Original Message -
From: "Paul Mone" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, July 16, 2001 7:24 AM
Subject: RE: Learning CFX


| Bryan,
| FYI, ColdFusion v5.0 comes with 5 java CFX examples in
| \CFUSION\cfx\java\distrib\examples\
|
|
| ---
| Paul Mone
| Ninthlink Consulting Group
| [EMAIL PROTECTED]
| http://www.ninthlink.com
| 619.222.7082
|
|
| -Original Message-
| From: Bryan LaPlante [mailto:[EMAIL PROTECTED]]
| Sent: Monday, July 16, 2001 4:57 AM
| To: CF-Talk
| Subject: Learning CFX
|
|
| I am learning to write cfx tag in Java. If anyone is aware of open source
| tags that I can learn from I would like to download them.
|
| Thanks
|
| Bryan LaPlante
| 816-347-8220
| [EMAIL PROTECTED]
| http://www.netwebapps.com
| Web Development
|
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Learning CFX

2001-07-16 Thread Paul Mone

Bryan,
FYI, ColdFusion v5.0 comes with 5 java CFX examples in
\CFUSION\cfx\java\distrib\examples\


---
Paul Mone
Ninthlink Consulting Group
[EMAIL PROTECTED]
http://www.ninthlink.com
619.222.7082


-Original Message-
From: Bryan LaPlante [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 16, 2001 4:57 AM
To: CF-Talk
Subject: Learning CFX


I am learning to write cfx tag in Java. If anyone is aware of open source
tags that I can learn from I would like to download them.

Thanks

Bryan LaPlante
816-347-8220
[EMAIL PROTECTED]
http://www.netwebapps.com
Web Development
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Learning CFX

2001-07-16 Thread Bryan LaPlante

I am learning to write cfx tag in Java. If anyone is aware of open source
tags that I can learn from I would like to download them.

Thanks

Bryan LaPlante
816-347-8220
[EMAIL PROTECTED]
http://www.netwebapps.com
Web Development


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists