import com.allaire.cfx.* ;

public class HelloWorld implements CustomTag {
  public void processRequest( Request request, Response response ) 
  throws Exception 
  {
    // Make sure a NAME attribute is passed to the tag
    if ( !request.attributeExists("NAME") ) {
      throw new Exception("The NAME attribute is required!");
    };
    
    // Make sure an AGE attribute is passed as well
    if ( !request.attributeExists("AGE") ) {
      throw new Exception("The AGE attribute is required!");
    };
    
    // Respond by inserting a text message in the calling ColdFusion file
    // The text will appear in place of the CFX tag in the final Web page
    response.write("<P>Hello there " + request.getAttribute("NAME") + "!");
    response.write("<BR>I hear you turned " + request.getAttribute("AGE"));
    response.write(" sometime during the past year. Happy birthday!<BR>");
  }
}