Listing 1
import com.allaire.cfx.*;
public class HelloWorld1 implements CustomTag
{
// custom tag entry point
public void processRequest(Request request, Response response)
{
String strName = null;
String strGreeting = null;
//
response.write((request.getAttributeList()).toString());
// retrieve/default the incoming argument
strName = request.getAttribute("NAME", "World");
strGreeting = "Hello, " + strName;
// write it back to the display stream
response.write(strGreeting);
}
}
Listing 2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Listing 3
import com.allaire.cfx.*;
import java.util.Hashtable;
public class HelloWorld2 implements CustomTag
{
// custom tag entry point
public void processRequest(Request request, Response response)
{
String strName = null;
String strGreeting = null;
// retrieve/default the incoming argument
strName = request.getAttribute("NAME", "World");
strGreeting = "Hello, " + strName;
// write it back to the display stream
response.write(strGreeting);
}
}
Listing 4
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Error!
No Query attribute passed."); } if(qry == null) { throw new Exception("
Error!
Unable to retrieve the query."); } nRowCount = qry.getRowCount(); nColumnIndex =
qry.getColumnIndex("NAME"); for(nRowIndex = 1; nRowIndex <= nRowCount; nRowIndex++)
{response.write("Hello, " + qry.getData(nRowIndex, nColumnIndex) + "
"); } } }