tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Randolph" <pran...@mail.cslf.org>
Subject RE: A common .properties file
Date Thu, 10 Apr 2003 20:27:22 GMT
Hello,

Yes, you have to move the file into the shared/classes directory as an extra step. Are you
also objecting to the use of ResourceBundle?


Paul Randolph
CSLF

Howdy,

>I used a different way. I put a file called 'common.properties' in my
>$CATALINA_HOME/shared/classes directory and I used this code:
>
>java.util.ResourceBundle rb =
java.util.ResourceBundle.getBundle("common");
>String prop = rb.getString("my.property");
>
>This is the same way I do it with the .properties files in my WEB-
>INF/classes directory, so this works out great for me.

Except, of course, this approach is specific to tomcat's classloading
hierarchy, and prevents you from having one war file for your webapp
because the resource bundle is not under your docBase.  So if someone
wants to have a single war file with the whole webapp that works in any
servlet 2.3-compliant container, the previous approach based on the
thread context class loader is better.

Yoav Shapira
Millennium ChemInformatics



This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message