FileDocCategorySizeDatePackage
GetLocalDateTag.javaAPI DocExample1974Thu Jun 28 16:14:16 BST 2001com.ora.jsp.tags.generic

GetLocalDateTag

public class GetLocalDateTag extends TagSupport
This class implements a custom action that inserts a date value, formatted according to the currently selected locale, in the response body. It uses the com.ora.jsp.beans.locale.LocaleBean.
author
Hans Bergsten, Gefion software
version
1.0

Fields Summary
private String
name
private Date
date
Constructors Summary
Methods Summary
public intdoEndTag()
Uses the LocaleBean, available in a scope as a variable specified by the "name" property, to format the date specified by the "date" property. The result is added to the response body.

        Object o = pageContext.findAttribute(name);
        if (o == null) {
            throw new JspException("LocaleBean named " + name + " not found");
        }
        if (!(o instanceof LocaleBean)) {
            throw new JspException("The object named " + name + 
                " is not a LocaleBean");
        }
        JspWriter out = pageContext.getOut();
        try {
            out.write(((LocaleBean) o).getDateString(date));
        }
        catch (IOException e) {} // Ignore
        return EVAL_PAGE;
    
public voidrelease()
Releases all instance variables.

        name = null;
        date = null;
        super.release();
    
public voidsetDate(java.util.Date date)
Sets the date value property.

param
value the numeric value

        this.date = date;
    
public voidsetName(java.lang.String name)
Sets the LocaleBean name property.

param
name the name of the LocaleBean

        this.name = name;