I understand you wanting to keep the data across the locale change request
though it's doubtful that it will be used much by an average user since they
usually pick the language first and don't change it in the middle of filling
out the form.

When I was trying to figure out a way to do it, subclassing was one of the
options but then I didn't want to make validation cumbersome because on
locale change you'd have to skip validating other parameters so you'd have
to check whether locale was changed in the validation logic pertinent to a
particular form and somehow making (every) form aware of locale change
didn't sit well with me for  I think changing locale is a different aspect
:) I'm still using Struts 1.0 so may be 1.1 has better mechanism to do that.

Cheers,
Ivan
----- Original Message -----
From: "James" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 05, 2003 4:15 PM
Subject: Re: Localisation


> Ivan..
>
> that is exactly what im looking for... cheers fella..
>
> my only quetion is if the view is a data entry screen, and they have
entered
> data.. when the view is returned to the entered data is lost.. is there a
> way round this.
>
> We thought about subclassing ActionClass and adding code to the execute
> method to check if the post was from the locale link or a 'proper' post..
> then all Actions could subclass this. This would allow us to populate the
> form with any entered data and hopefully avoid the headache of having to
> re-enter everything. does this sound feasible??
>
>
> "Ivan N. Zhidov" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I had a similar situation which I resolved the following way:
> > LocalActionClass sets the locale to whatever comes in the language
> parameter
> > from the LocaleForm if it supports so you have multiple
> ApplicationResources
> > files for each of the languages you'd like to support. Then it forwards
> the
> > request back to the view it came from. Now the trick here was that I
> wanted
> > to describe this action only once in struts-config.xml
> >     <!-- Locale Action from Device Confirmation View-->
> >     <action
> >       path="/locale"
> >       type="LocaleAction"
> >       name="localeForm"
> >       scope="request"
> >     >
> >     </action>
> >
> > and I defined all the pages where the user can change the locale as
global
> > forwards
> >   <global-forwards>
> >     <forward name="home" path="/index.vm"/>
> >     <forward name="rv" path="/registrationView.vm"/>
> >     <forward name="cv" path="/confirmationView.vm"/>
> >   </global-forwards>
> >
> > so your link to change a locale from index.vm would be <a
> > href="/exp/locale.action?view=home&language=spanish"><img
> > src="images/spanish.jpg" border=0></a>
> >
> > and from registrationView.vm     <a
> > href="/exp/interface.action?view=rv&language=spanish"><img
> > src="images/spanish.jpg" border=0></a>
> >
> > locale form has two parameters: view and language. Since I use global
> > forwards instead of real view names, my user never sees them.
> >
> > Cheers,
> > Ivan
> > ----- Original Message -----
> > From: "James" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, March 05, 2003 2:11 PM
> > Subject: Localisation
> >
> >
> > > I have a LocaleActionClass that sets the locale according to which wee
> > flag
> > > the user clicks, my question is how in the struts-config.xml do i
> specify
> > it
> > > to forward to the page they changed locale on (i.e their original
page).
> > >
> > > James
> > >
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to