Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
My code (using the JavaMail API) works fine when the SMTP host name is hard coded in the program:
Then, I tried to put the host name in a properties file (smtpServer.properties). The properties file is in the $TOMCATHOME\webapps\AppName\WEB-INF\classes\resources directory. And the properties file has this one single line:
First, I would try to do a sysout on the actual String you think you are getting back from the properties file. Chances are, this will tell you if you're getting a null String or not. Second, you may want to use the File.separator in your file path for the properties file. File.separator will ensure that no matter what type of OS this is running on, you will always get the proper folder separator and don't have to worry about escaping the file separator character.
You get good luck from rubbing the belly of a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth