struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Punyansky, Alex" <Alex.Punyan...@Cybic.com>
Subject RE: PropertyTag question/suggestion
Date Mon, 06 Nov 2000 17:07:04 GMT
Thanks Oleg,

Looking in your code I realized I was so far behind by using Struts 0.5
:-). There are a lot of changes. I'm going to change my code to use the
latest version of struts and to use the tag that you gave me. I also
plan to add support for percentages and currency formatting into
FormatTag. 

Alex

-----Original Message-----
From: Oleg V Alexeev [mailto:gonza@penza.net]
Sent: Saturday, November 04, 2000 4:33 AM
To: Punyansky, Alex
Subject: Re: PropertyTag question/suggestion


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:gonza@penza.net

Mime
View raw message