Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 1179 invoked from network); 20 Feb 2000 12:23:07 -0000 Received: from cindy.kollegienet.dk (HELO odense.kollegienet.dk) (qmailr@130.226.80.138) by locus.apache.org with SMTP; 20 Feb 2000 12:23:07 -0000 Received: (qmail 19160 invoked from network); 20 Feb 2000 12:23:00 -0000 Received: from unknown (HELO kaa.hco.kollegie.dk) (root@172.16.8.10) by cindy.kollegienet.dk with SMTP; 20 Feb 2000 12:23:00 -0000 Received: from hco.kollegienet.dk (n1203aa.hco.kollegie.dk [172.16.9.132]) by kaa.hco.kollegie.dk (8.8.7/8.8.7) with ESMTP id NAA21573; Sun, 20 Feb 2000 13:22:56 +0100 Message-ID: <38AFDB9C.8255DF16@hco.kollegienet.dk> Date: Sun, 20 Feb 2000 13:18:36 +0100 From: Anna Stepanova X-Mailer: Mozilla 4.61 [en] (OS/2; I) X-Accept-Language: ru,en MIME-Version: 1.0 To: general@jakarta.apache.org CC: tomcat-dev@jakarta.apache.org Subject: Re: request for comments about Multilinguage JSP References: <38AAFC11.BDA50080@earthlink.net> <38AB26C4.F8CBC134@hco.kollegienet.dk> <38AF6498.9BF60E42@us.oracle.com> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Jose Alberto Fernandez wrote: > I would suggest using the same mechanism as resource bundles. > That is: > > index_en.jsp > index_en_US.jsp > > and so on and so forth. This allows a lot of flexibility and the only > thing required is for a way for the webserver to decide the locale to > us. What the difference bewtween index_en.jsp and index.en.jsp ? You can use system resource loader or class loader here. I think better if it will be look like web server files for negotiation. > By the way, the need is not only for JSPs but I can see the same need > for > Servlets in general. Of course it is upto users to decide what to use. I have implemented this feature for GNUJSP (but not released it yet). I don't think that this feature needs for servlets. There are better way to use resources. Like this: public void doGet( HttpServletRequest req, HttpServletResponse res) { ResourceBundle resources = getResourceForLocaleFromHeaders( req, "yourResources"); ... out.print( resources.getString( yourResources.SOME_STRING_RESOURCE)); } For better performance you must have resources pool for different locales. Resources must look like this: -------------------- import java.util.ListResourceBundle; public class yourResources extends ListResourceBundle { public Object[][] getContents() { return contents; } static final String SOME_STRING_RESOURCE = "someString"; static final String ANOTHER_STRING_RESOURCE = "someString"; static final Object contents[][] = {{ SOME_STRING_RESOURCE, "This is some string from resources"}, { ANOTHER_STRING_RESOURCE, "This is another string from resources"}}; } etc. Eugen Kuleshov.