Article View: borland.public.jbuilder.java.api
Article #1333Re: loading a resource bundle
From: Gillmer J. Derge [TeamB]
Date: Sun, 10 Mar 2002 20:55
Date: Sun, 10 Mar 2002 20:55
37 lines
2390 bytes
2390 bytes
"Fernando Racca" <lord_ice@speedy.com.ar> wrote in message
news:3c8bb859_1@dnews...
> its quite a simple problem.. but i cant find the problem...
>
> i�m trying to load a property file with the resource bundle...
> but my property file is not in the package where the class is...
> its in another completly different package...
>
> os i don�t know what name to use for ladoing it...
>
> im trying this at the moment and is not working
It shouldn't matter what package it's in as long as you include the package
in the path you give to getBundle. Say your class is
com.mydomain.mypackage1.MyClass and the properties file is
com.mydomain.mypackage2.myproperties.properties. The following call to
getBundle should work.
resourceBundle =
ResourceBundle.getBundle("com.mydomain.mypackage2.myproperties");
> ----------------------------------------------------------
>
> resourceBundle = ResourceBundle.getBundle(
> LANGUAGES_DIR +
> resBundleName, new Locale("ES"),
> ClassLoader.getSystemClassLoader());
> ----------------------------------------------------------
>
> i suppose that the code is self-explanatory...
Not without knowing the value of LANGUAGES_DIR and resBundleName. Those
are obviously critical to finding the file. Without knowing the value of
those variables, it's hard to say what the problem is.
--
Gillmer J. Derge [TeamB]
Technical Details
Message-ID:
<3c8bc81e_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!213.56.195.71!fr.usenet-edu.net!usenet-edu.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3c8bb859_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 1089d0,8dd7fd1125fb6e76 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-03-10 13:09:24 PST From: "Gillmer J. Derge [TeamB]" <spam@gillmerderge.com> Newsgroups: borland.public.jbuilder.java.api References: <3c8bb859_1@dnews> Subject: Re: loading a resource bundle Date: Sun, 10 Mar 2002 15:55:02 -0500 Lines: 40 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 24.29.81.241 Message-ID: <3c8bc81e_1@dnews> X-Trace: dnews 1015793694 24.29.81.241 (10 Mar 2002 12:54:54 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!213.56.195.71!fr.usenet-edu.net!usenet-edu.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews