tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Accessing resource in WEB-INF outside servlet
Date Mon, 08 Nov 2004 14:21:33 GMT


>public static Book getBook(String bookId)
>public static void updateBook(Book book)
>So in order to preserve that cleanliness, the methods have to get the
>connection path themselves, which was why i was so excited by the JNDI

Having each Bean get its own connection path itself is not clean, but
it's your design, so it's up to you.  You can use the other approach
mentioned (but shunned) by the original poster, which is to put said
configuration information on the classpath.  Then each of your classes
can get getClass().getResource("/myConfigFile.prop") to get the
configuration.  That's much more testable and portable, doesn't depend
on a container, doesn't depend on the Servlet API.


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:
For additional commands, e-mail:

View raw message