This is probably just about as easy with any mature framework.  You
are probably using Struts, since you asked a Struts list, so I will
give you a Struts sort of answers, rather than Pearl, JSF, C#, NET, or
whatever.  First, however, to answer your question rather than try to
sell my wares, I have to get some information from you.  Do you want
merely to know how to connect to all the options and display the
possibilities to the client or do you want the process to be dynmic
for the server side as well?  The former is easier and makes more
sense to me, but you can do both with Struts without much ado.

Jack

On 4/13/05, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> On 4/13/05, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> > Hi
> > How to find out which language property files are
> > availble in a web project, for example i have
> > test.properties, test_fr_FR.properties,
> > test_ru.properties file in WEB-INF\classes folder, how
> > to identify on the fly what languages property files
> > are availble and then display it  in a jsp so the user
> > can select the language he wants to see the web site
> >
> 
> I don't know of any quick-and-easy way to do this (unless you are
> using JSF, where you declare the supported locales explicitly in a
> faces-config.xml file).  But here's a brute force strategy that should
> work, if you are on a Servlet 2.3 or later container.
> 
> * Call ServletContext.getResourcePaths("/WEB-INF/classes"), which
>   returns you a set of context relative paths to all the files under your
>   /WEB-INF/classes subdirectory.
> 
> * Scan down this list and match the ones that are related to your
>   resource bundle (i.e. things that match "*/text*.properties") to
>   build your list of available locales.
> 
> * If you have properties files in JARs under /WEB-INF lib, you can
>   use ServletContext.getResourcePaths() again to get paths to all
>   the JAR files.  Then, you can use the utility classes in java.util.jar
>   to scan the table of contents of each JAR file and (again) match
>   the names to an appropriate pattern.
> 
> > Ashish
> 
> Craig
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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

Reply via email to