Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Read from a local File in JSP  RSS feed

 
Denise Advincula
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,

First of all, thank you for all the help. I have another problem regarding reading local files. I need to display the contents of a file stored in a local directory. The file and file location is always the same hence I don't need to use the File Chooser.

Here's my code but it doesn't work:



I tried using other read file methods but I guess the getResource method is the perfect solution. I'm just not sure if I'm correct. I hope you can help me. Thank you!
 
Denise Advincula
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys, I got it. I tried everything but I bypassed the easiest one:

FileReader file = new FileReader(location and file name); //just hardcoded.
BufferedReader br = new BufferedReader(file);

Anyway, thank you very much for your time!
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!