FileDocCategorySizeDatePackage
CustomerFmtTag.javaAPI DocGlassfish v2 API4583Sat May 05 19:17:12 BST 2007org.apache.taglibs.standard.examples.taglib

CustomerFmtTag

public class CustomerFmtTag extends TagSupport

Tag handler for <customerFmt>

author
Pierre Delisle
version
$Revision: 1.3 $ $Date: 2007/05/06 02:17:11 $

Fields Summary
private org.apache.taglibs.standard.examples.beans.Customer
customer
Holds value of property customer.
private String
fmt
Holds value of property fmt.
Constructors Summary
public CustomerFmtTag()

        super();
        init();
    
Methods Summary
public intdoStartTag()

        JspWriter out = pageContext.getOut();
        try {
            if (fmt.equalsIgnoreCase("short")) {
                out.println(customer.getFirstName() + " " +
                customer.getLastName());
            } else if (fmt.equalsIgnoreCase("long")) {
                out.println(customer.getFirstName() + " " +
                customer.getLastName() + " " + customer.getAddress());
            } else {
                out.println("invalid format");
            }
        } catch (IOException ex) {}
        
        return SKIP_BODY;
    
public org.apache.taglibs.standard.examples.beans.CustomergetCustomer()
Getter for property customer.

return
Value of property customer.

        return customer;
    
public java.lang.StringgetFmt()
Getter for property fmt.

return
Value of property fmt.

        return fmt;
    
private voidinit()

        customer = null;
        fmt = null;
    
public voidrelease()

        super.release();
        init();
    
public voidsetCustomer(org.apache.taglibs.standard.examples.beans.Customer customer)
Setter for property customer.

param
customer New value of property customer.

        this.customer = customer;
    
public voidsetFmt(java.lang.String fmt)
Setter for property fmt.

param
fmt New value of property fmt.

        this.fmt = fmt;