RE: placement of properties files
I think web-inf folder - since tomcat wont serve files contained therein. -Original Message- From: Timothy Stone [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 8:55 AM To: Tomcat Users Subject: placement of properties files Q: where is the proper place for [props].properties files? such as something that might store username and password pairs. Not the best practice, but if one wanted to. Thanks, Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placement of properties files
I'd recommend WEB-INF/classes - then it's in the classpath. -Original Message- From: Schwartz, David (CHR) [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 6:57 AM To: 'Tomcat Users List' Subject: RE: placement of properties files I think web-inf folder - since tomcat wont serve files contained therein. -Original Message- From: Timothy Stone [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 8:55 AM To: Tomcat Users Subject: placement of properties files Q: where is the proper place for [props].properties files? such as something that might store username and password pairs. Not the best practice, but if one wanted to. Thanks, Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placement of properties files
Howdy, I agree with under WEB-INF as that's a directory the servlet container will protect for you. I don't like to put configuration information on the classpath however. I prefer to access them via other mechanisms, such as the ServletContext. So I would create a directory called config under WEB-INF, put the file (say a.props) there, and access it via InputStream is = ServletContext.getResourceAsStream(/WEB-INF/config/a.props); Yoav Shapira Millennium ChemInformatics -Original Message- From: Raible, Matt [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 9:02 AM To: 'Tomcat Users List' Subject: RE: placement of properties files I'd recommend WEB-INF/classes - then it's in the classpath. -Original Message- From: Schwartz, David (CHR) [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 6:57 AM To: 'Tomcat Users List' Subject: RE: placement of properties files I think web-inf folder - since tomcat wont serve files contained therein. -Original Message- From: Timothy Stone [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 8:55 AM To: Tomcat Users Subject: placement of properties files Q: where is the proper place for [props].properties files? such as something that might store username and password pairs. Not the best practice, but if one wanted to. Thanks, Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: placement of properties files
Shapira, Yoav wrote: Howdy, I agree with under WEB-INF as that's a directory the servlet container will protect for you. I don't like to put configuration information on the classpath however. I prefer to access them via other mechanisms, such as the ServletContext. So I would create a directory called config under WEB-INF, put the file (say a.props) there, and access it via InputStream is = ServletContext.getResourceAsStream(/WEB-INF/config/a.props); Yoav Shapira Millennium ChemInformatics Good options all. I was leaning towards /WEB-INF/. I like Yoav's suggestion for the more pure organizational aspect. However, could one also just: InputStream is = ServletContext.getResourceAsStream( /WEB-INF/a.props); ? Tim -Original Message- From: Raible, Matt [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 9:02 AM To: 'Tomcat Users List' Subject: RE: placement of properties files I'd recommend WEB-INF/classes - then it's in the classpath. -Original Message- From: Schwartz, David (CHR) [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 6:57 AM To: 'Tomcat Users List' Subject: RE: placement of properties files I think web-inf folder - since tomcat wont serve files contained Q: where is the proper place for [props].properties files? such as something that might store username and password pairs. Not the best practice, but if one wanted to. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placement of properties files
Howdy, Good options all. I was leaning towards /WEB-INF/. I like Yoav's suggestion for the more pure organizational aspect. However, could one also just: InputStream is = ServletContext.getResourceAsStream( /WEB-INF/a.props); ? One could, sure. And if you have a small system / few files, that might even be the best option. I just like to be organized where possible, so if a.props is a configuration file I like to put it in a config subdirectory. Some of our apps have config, SQL, log, other files and sticking them all under WEB-INF can get ugly. Yoav Shapira 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placement of properties files
I did that for a while but changed when teting them became difficult. By putting them in the classpath, you can test without any monkey-business (tech. term) to get the ServletContext, and the class that gets the config is also not coupled to servlets, so I can use it for a swing app, or command line utility. Larry [EMAIL PROTECTED] 05/28/03 7:10 AM I don't like to put configuration information on the classpath however. I prefer to access them via other mechanisms, such as the ServletContext. So I would create a directory called config under WEB-INF, put the file (say a.props) there, and access it via InputStream is = ServletContext.getResourceAsStream(/WEB-INF/config/a.props); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placement of properties files
Howdy, We actually hold the configuration in a bean-like class. We have a configurator utility class that exposes a couple of configure methods: one that takes a ServletContext, another an InitialContext, another a filesystem path to config directory. So we can (and do, in production) use the same app from the command-line, in an J2EE container, in a servlet-only container, etc. You could do it all using classpath-based resource location, and avoid having to write a configurator like the above. But I'm really nitpicky about project source / deployment organization, and I can physical twitches when I see configuration files on the classpath. OK, maybe I'm not that picky, but I still dislike it ;) Yoav Shapira Millennium ChemInformatics -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 10:23 AM To: [EMAIL PROTECTED] Subject: RE: placement of properties files I did that for a while but changed when teting them became difficult. By putting them in the classpath, you can test without any monkey-business (tech. term) to get the ServletContext, and the class that gets the config is also not coupled to servlets, so I can use it for a swing app, or command line utility. Larry [EMAIL PROTECTED] 05/28/03 7:10 AM I don't like to put configuration information on the classpath however. I prefer to access them via other mechanisms, such as the ServletContext. So I would create a directory called config under WEB-INF, put the file (say a.props) there, and access it via InputStream is = ServletContext.getResourceAsStream(/WEB-INF/config/a.props); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]