Dear all,
I am working on a very interesting project.
There is only one application server instance. The instance has to serve
many countries ctry1, ctry2, ctry3 and ctry4 at the same time, which will
have country specific functionalities. Assume that these different conutries
have their own war files. All war files whould depend on a single jar file,
which , lets call as the reusable common codebase.
How can I design the application such that the presentation layer is not
repeated across countries, but in some country some fileds will appear, some
kinds of validations of currency convertions take place etc, so that when we
access the URL for a country, then the view is rendered as per that
conutry's requirement?
Thanks and regards,
Ravi
Wojtek - 06 Nov 2007 21:44 GMT
Ravion wrote :
> Dear all,
>
[quoted text clipped - 11 lines]
> access the URL for a country, then the view is rendered as per that conutry's
> requirement?
Rather than a bunch of WAR files and a common JAR library, why not just
have one WAR file and use the Locale class?
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Locale.html
Then let the user choose their Locale. For validation or pre-fill you
only need to test for which Locale the user is using.

Signature
Wojtek :-)
Roedy Green - 07 Nov 2007 07:57 GMT
On Wed, 7 Nov 2007 05:34:06 +0800, "Ravion"
<ravishankar@singnet.com.sg> wrote, quoted or indirectly quoted
someone who said :
>How can I design the application such that the presentation layer is not
>repeated across countries, but in some country some fileds will appear, some
>kinds of validations of currency convertions take place etc, so that when we
>access the URL for a country, then the view is rendered as per that
>conutry's requirement?
Probably the easiest way is to use ResourceBundles, and put everything
in one giant jar. You could use a Java Applet to determine the locale
and send that to the server. Then you use the ordinary localisation
techniques to select the correct ResourceBundles for each
transaction.
see http://mindprod.com/jgloss/localisation.html
http://mindprod.com/jgloss/resourcebundle.html

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Andrew Thompson - 07 Nov 2007 08:43 GMT
>On Wed, 7 Nov 2007 05:34:06 +0800, "Ravion"
><ravishankar@singnet.com.sg> wrote, quoted or indirectly quoted
>someone who said :
>...You could use a Java Applet to determine the locale
>and send that to the server. ...
The best strategy would probably be to have the applet
*suggest* a locale to the user, but allow the user to override
it as needed. I was sitting beside someone at a computer
today, who was looking for news in Vietnamese, whereas
the default Locale settings of the PC would have suggested
English.
(I vaguely object to sites that think they are so clever
about giving 'what I want' that they do not offer a choice!)

Signature
Andrew Thompson
http://www.athompson.info/andrew/