Re: i18n & ActionErrors

David Stabel <[email protected]>
Newsgroups gmane.comp.java.strutscx.user
Organization Oce Printing Systems GmbH
Message-ID <[email protected]>
Hi Ninit,

Concerning your question about i18n.
I also found out that the variables are not automatically set by the 
StrutsCX framework (talking about V0.9.2, I did not yet checked out 
V0.9.3). To solve this problem I added the following code in my 
ActionBase class (see I18N CODE SAMPLE):

----------- I18N CODE SAMPLE START ----------------
// set the prefered user locale
if (request.getLocale() != null) {
   session.setAttribute(StrutsCXConstants.LOCALE,
                        request.getLocale().getLanguage() );
   session.setAttribute(StrutsCXConstants.COUNTRY,
		       request.getLocale().getDisplayCountry() );
} else {
    // no locale found in request, use server default instead
}
----------- I18N CODE SAMPLE END ----------------

Using this code, the Locale is determined by the browser's settings.
Basic idea is that you must set the Locale manually for the 
StrutsCXServlet in order to let the StrutsCXServlet pick up the desired 
  variables.

Concerning your question about the ActionError.
See the following explanation on the StrutsCX site (Errorhandling with 
StrutsCX):
http://it.cappuccinonet.com/strutscx/doc/v08/en/intro/ar01s04.html
You must also not forget to add the error container to the 
StrutsCXServlet => request.setAttribute(StrutsCXConstants.XML_ERROR, 
errors);
That should answer your question.
Hope this help :)

Kind regards, David Stabel.



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.