tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Properties
Date Mon, 30 Aug 2004 12:55:08 GMT

Hi,

>yes Yoav,
>but you need that functionality for example when you want to acces to a
>Property
>file.
>If you use the defaut path, Tomcat will search after the file in the
work
>directory which is not very fun. With the entire path you are then able
to
>find it.

RTFM on Class#getResource and ServletContext#getResource.

>Of course you will tell me that we just have to put properties in the
>web.xml

A bit presumptuous this morning? ;)  No, that's not what I'd tell you.
You can put the properties in a separate file.  Use either of the above
two methods to load the file.

>but if you want to share your properties with other applications (Batch
for
>example) you will then not be able to retreive your properties without
>parsing
>entirely web.xml wich is not to fun too ;-)

Sharing configuration files between applications is something the
Servlet Spec frowns upon a bit, as webapps should be self-contained.
But if you have to do it, put the file in a shared classloader
repository (such as common/lib, common/classes, shared/lib, or
shared/classes in Tomcat) and use the Class#getResource approach.

Yoav



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


Mime
View raw message