That is what I understood.

The "localeform" is sugested can be added in every JSP (that is able to
redisplay fine). It has to take as parameter the locale selected and the
incoming JSP page, to be able to set Locale and to redisplay the JSP.

You can get a JSP URL when rendering using request.getRequestURL().

for example, this code put a FR flag on your JSP, allowing to call
ChangeLocaleAction, that will use "locale" parameter to set locale and
"display" parameter as forwarding URL.

<form action="/changeLocale.do" method="post">
  <input type="hidden" name="display" value="<%=request.getRequestURL()%>" >
  <input type="hidden" name="locale" value="FR_fr" >
  <input type="image" src="flag_fr.gif">
</form>

Notice that your JSP has to use "session" scoped attributes (not "request")
to be able to redisplay.

Nico.

> I left out some important information from the question I posed earlier:
>
> original question:
>
> > >
> > > Is there a way to set the "forward" page to be the same page that
originated
> > > the request?
> >
> > >
> > > I want to enable users to change locale with a button. But I don't
> > > want them to go anywhere else after submitting their form.
> > >
> > > Here is an example to illustrate what I want to do (obviously, I know
> > > "path=thesamepage" won't work :-)).
> > >
> > >    <action   path="/changeLocale"
> > >               type="dk.au.registration.oekonomi.student.LocaleAction"
> > >               name="localeform"
> > >               scope="request"
> > >               validate="false"
> > >         <forward name="success" path=thesamepage>
> > >     </action>
>
> new information:
>
> I want to put "changeLocale" form (a flag button) on every .jsp page and
not
> specify a single input page in the action mapping. Therefore, I want the
> controller to somehow know what page the request came in on, and "forward"
the
> response back to that original requesting page, whatever it is.
>
> Thanks!
>
> Heather
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


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

Reply via email to