[英]where to put the text file in web application
I have email manager and I load the email contents from the text files. 我有电子邮件管理器,并且从文本文件加载电子邮件内容。 I load the text files from the class path.
我从类路径加载文本文件。 When I test in the java SE environment, it works well.
当我在Java SE环境中进行测试时,它运行良好。 When I used the email Manager in web application, I got the
FileNotFoundException
. 在Web应用程序中使用电子邮件管理器时,出现
FileNotFoundException
。 I would like to know where can I put the text files to load successfully in web application? 我想知道如何将文本文件放在Web应用程序中成功加载?
Edit 编辑
In the email manager, 在电子邮件管理器中,
FileReader fr = new FileReader("EmailContent.txt");
WebContent应该是正确的位置,而无需定义适用于tomcat的路径
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.