Hi,

I am trying to write a multi-language system which will accept localised
input in
one of 2 countries, namely Austria and England (and later Italy). The
problem
is that of trying to validate and also to convert input. I would like to
be able to validate
dates and numbers using the built-in standard validator-rules 
(eg 'double' via
org.apache.struts.validator.FieldChecks.validateDouble). Using the date
validator means I just need to set a new datePatternStrict which is
easily done using
localised formsets with different constants. However the double
formatting falls over
on valid Austrian prices (eg 5,99), since there is no localisation in
this check. Since
my application is now rather large and has all been coded for the UK so
far I don't
want to have to add conversion in all my ActionForms or to change all my
validation to
masks!

To get around putting conversion in the ActionForms I am currently
subclassing the
RequestProcessor to translate (according to some config) locale specific
formats to
UK formats. However, as I want any invalid input to be picked up by the
validator framework
which I am currently using, I do this after the call to
processValidate().

Is there a better way to do this input translation which would be quick
but yet clean to
implement?

And is there anyway to make the validator framework locale aware, apart
from writing my
own checks or using masks?

Thanks

Dave


The information contained in this e-mail is intended only for the person
or
entity to which it is addressed and may contain confidential and/or
privileged material. If You are not the intended recipient of this
e-mail,
the use of this information or any disclosure, copying or distribution
is
Prohibited and may be unlawful. If you received this in error, please
contact the sender and delete the material from any computer. The views
expressed in this e-mail may not necessarily be the views of The PCMS
Group
plc and should not be taken as authority to carry out any instruction
contained.
 

Reply via email to