This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Attachment file not found error! Pls suggest  RSS feed

 
Himanshu Bisht
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing the output of a query onto a text file and then sending the same file as mail attachment using a servlet.

The problem is that in both the case (while writing to the file and attaching) the program is not able to locate the file(while writing it is making the same file under the bin directory of tomcat).

Though the program works fine when i give absolute path.

Please suggest
 
Richard Bradford
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the HttpServletRequest.getRealPath(..) method.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!