Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

accessin a class from a jsp  RSS feed

 
king_preetham
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a java class which opens a text file and reads some data. When i write a client program and call the mthod from the class, it executes fine. Now i create an instance of this class in a jsp and call the method. It now throws me an exception when it tries to open the file for reading. It says file not found exception while tryin to open the text file.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would bet that you are trying to open the file without an absolute path. In a servlet or jsp you can't rely on a particular directory being the "logged in" directory.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!