Hello Alex,
Some time ago I write FormatTag inherited from WriteTag. It contains
logic to support i18n for Date and Number objects and additionally
format string can be added to tag parameters. For example -
<bean:format name="mybean" property="numberPrp" format="##.##" />
<bean:format name="mybean" property="datePrp" format="yyyy.MM.dd" />
And without format parameter it use current locale from session
attribute ( name in org.apache.struts.Action.LOCALE_KEY ) to convert
Date and Number objects to String.
Saturday, November 04, 2000, 12:35:50 AM, you wrote:
PA> Hi,
PA> I need to write a tag FormatNumberPropertyTag that takes a number from
PA> the bean, formats it and displays it. E.g., the price should have 2
PA> fraction digits and have grouping enable, id number should have no
PA> fraction digits and no grouping.
PA> I decided to extend the PropertyTag ( this tag does what I need except
PA> formatting ) by adding a formatType attribute. But the name is defined
PA> as private member variable in PropertyTag and therefore I have to
PA> recreate it in my tag. I could make my tag inherit from BaseInputTag but
PA> I think it makes more sense to inherit from PropertyTag.
PA> So my questions are :
PA> 1. Why the name variable was made private in PropertyTag? Maybe I'm
PA> missing something.
PA> 2. Should/Can it be changed to be protected?
PA> P.S. Craig, can you tell me what FWIW means (FWIW, I do
PA> not think of this as a "scriplet" -- it's just a compiler command :-)).
PA> Thanks
--
Best regards,
Oleg mailto:[EMAIL PROTECTED]
FormatTag.java