Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to put an external resource bundle file on the classpath inStruts?

Reply
Thread Tools

How to put an external resource bundle file on the classpath inStruts?

 
 
John
Guest
Posts: n/a
 
      04-16-2008
Hi all,
usually for internationalization I use the resource bundle properties
and use the <bean:message> Struts tag for the different Locales.
Normally this is internal to the web application (everything resides
within the *.ear file).
However, because of a change in the business requirement, I have to
externalize all *.properties file - they cannot be part of the web
application, but must be located in an external location (on a Solaris
machine).

Since all my JSPs uses <bean:message> I should find a solution for the
problem that the Struts framework will no longer find the *.properties
files under the WEB-INF/classes directory.

Since I want to keep the JSPs as they are, I thought maybe there is a
way to load all the *.properties files on the classpath, when the
application starts:

let's say all properties are located in

/etc/apps/i18n

Now: I have a single file that initializes all kind of application
specific variables. One of these variables could be the key that maps
the directory of all *.properties. And now my trouble begins: I don't
know how, and if it is possible to load the value of that key and put
the files on the web application classpath, so that Struts can use its
internationalization mechanism.

Does anybody has a tip or hint how to do this? Maybe with a piece of
code please....

Thank you very much for your answers,
John
 
Reply With Quote
 
 
 
 
Abhijat Vatsyayan
Guest
Posts: n/a
 
      04-16-2008
John wrote:
> Hi all,
> usually for internationalization I use the resource bundle properties
> and use the <bean:message> Struts tag for the different Locales.
> Normally this is internal to the web application (everything resides
> within the *.ear file).
> However, because of a change in the business requirement, I have to
> externalize all *.properties file - they cannot be part of the web
> application, but must be located in an external location (on a Solaris
> machine).
>
> Since all my JSPs uses <bean:message> I should find a solution for the
> problem that the Struts framework will no longer find the *.properties
> files under the WEB-INF/classes directory.
>
> Since I want to keep the JSPs as they are, I thought maybe there is a
> way to load all the *.properties files on the classpath, when the
> application starts:
>
> let's say all properties are located in
>
> /etc/apps/i18n
>
> Now: I have a single file that initializes all kind of application
> specific variables. One of these variables could be the key that maps
> the directory of all *.properties. And now my trouble begins: I don't
> know how, and if it is possible to load the value of that key and put
> the files on the web application classpath, so that Struts can use its
> internationalization mechanism.
>
> Does anybody has a tip or hint how to do this? Maybe with a piece of
> code please....
>
> Thank you very much for your answers,
> John

Sounds like a strange thing to do but if you must ) .. what server
are you using? Which version of struts?
 
Reply With Quote
 
 
 
 
John
Guest
Posts: n/a
 
      04-17-2008
On Apr 17, 1:38 am, Abhijat Vatsyayan <(E-Mail Removed)> wrote:
> John wrote:
> > Hi all,
> > usually for internationalization I use the resource bundle properties
> > and use the <bean:message> Struts tag for the different Locales.
> > Normally this is internal to the web application (everything resides
> > within the *.ear file).
> > However, because of a change in the business requirement, I have to
> > externalize all *.properties file - they cannot be part of the web
> > application, but must be located in an external location (on a Solaris
> > machine).

>
> > Since all my JSPs uses <bean:message> I should find a solution for the
> > problem that the Struts framework will no longer find the *.properties
> > files under the WEB-INF/classes directory.

>
> > Since I want to keep the JSPs as they are, I thought maybe there is a
> > way to load all the *.properties files on the classpath, when the
> > application starts:

>
> > let's say all properties are located in

>
> > /etc/apps/i18n

>
> > Now: I have a single file that initializes all kind of application
> > specific variables. One of these variables could be the key that maps
> > the directory of all *.properties. And now my trouble begins: I don't
> > know how, and if it is possible to load the value of that key and put
> > the files on the web application classpath, so that Struts can use its
> > internationalization mechanism.

>
> > Does anybody has a tip or hint how to do this? Maybe with a piece of
> > code please....

>
> > Thank you very much for your answers,
> > John

>
> Sounds like a strange thing to do but if you must ) .. what server
> are you using? Which version of struts?


We are using Solaris 10 maschines, Struts 1.1 (I know, I know, but
this is what it is allowed in our company), JDK 1.5, J2EE 1.4(Servlet
2.4, JSP 2.0 and JSTL 1.1). Can this help you for my problem?

Thank you,
John
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: AMD QUAD CORE Phenom bundle (Maplins bundle) won't let me install WinXP! Centre Parting Computer Support 0 05-05-2009 05:58 PM
Re: AMD QUAD CORE Phenom bundle (Maplins bundle) won't let me install WinXP! VanguardLH Computer Support 0 05-05-2009 04:52 PM
Re: AMD QUAD CORE Phenom bundle (Maplins bundle) won't let me install WinXP! Buffalo Computer Support 0 05-05-2009 04:16 PM
How to put an external resource bundle file on the classpath inStruts? giovanni.suter@gmail.com Java 0 08-05-2008 11:13 PM



Advertisments