Are you talking about prepopulating the form? Yes, a FormUtils method helps with that. I don't know if that qualifies as manually populating the form, though. The FormUtils method does a lot of the manual work, such as matching form fields with their POJO field counterparts, considering the locale, converting and parsing data as needed, possibly handling nested beans/nested forms as well.
Hubert On 1/19/07, Zero <[EMAIL PROTECTED]> wrote:
Hi, Thanks ! It is exactly what I need. I'm going to test it... Must I always populate manually all the forms (with FormUtils) ? Regard, Zero ---------- Initial Header ----------- From : "Hubert Rabago" <[EMAIL PROTECTED]> To : "Struts Users Mailing List" <user@struts.apache.org> Cc : Date : Thu, 18 Jan 2007 09:52:57 -0600 Subject : Re: Form population and locale On 1/17/07, Zero <[EMAIL PROTECTED]> wrote: > Hi everybody, > > I use Struts 1.2.9 and I would like to know if there is any > way to link the user locale (available with > RequestUtils.getUserLocale(HttRequest)) with the form > population process. > > In fact, I have many forms which have date field (with the > java.util.Date type). I would format these fields according > to the user locale (ie. "yyyy/MM/dd" for english users and > "dd/MM/yyyy" for french users). Also, I would like that the > automatic form population do the same thing. I have a Struts extension [1] that allows you to do this. If you get the binary download, there's a sample app (locale.war) which demonstrates the form accepting dates (02/15/1999 vs. 15/02/1999) and numbers (40,000.50 vs. 40.000,50) formatted depending on the user's locale. > > Thanks a lot ! > Regards, > Zero - Hubert [1] https://formdef.dev.java.net/ --------------------- ALICE SECURITE ENFANTS --------------------- Protégez vos enfants des dangers d'Internet en installant Sécurité Enfants, le contrôle parental d'Alice. http://www.aliceadsl.fr/securitepc/default_copa.asp --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]