This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
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

FileNotFoundException  RSS feed

 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi - I get the following error.

java.io.FileNotFoundException: E:\Java7\netbeans\Chap5Murach\build\web\WEB_INF\EmailList.txt (The system cannot find the path specified)

Code:


in JSP I have



I didn't create the EmailList.txt file in web_inf folder at first. But after I received the same filenotfound error for a while,I thought fileWriter class wouldn't create the file on its own and created the txt file in web_inf folder. But still I get the same error while run. Please help me. Thanks



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66143
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WEB-INF. Not WEB_INF, not web_inf, not anything else. WEB-INF.

And, you are putting Java code in a JSP? In (almost) 2014?
 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about the WEB-INF mistake. I am learning web development with Murach servlet and jsp book and this is the beginning chapter with html and jsp. So that application is added java code in JSP file. I am using Tomcat server and I find it very hard to debug in Ecllipse and I switched back to netbeans and debugging this one. Kindly help resolve this exception,please
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shiva Mohan wrote:Kindly help resolve this exception,please


So is it fair to assume that you have corrected the error pointed out by Bear? If so, then you're going to have to show us the exception you're getting now and the revised code.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66143
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, be aware that putting Java code in a JSP is a bad practice that has been obsolete and discredited since 2001. Java code should no longer be used in a JSP page.

It's useful to know how it works in case you run across legacy pages that still use Java code in JSPs, but new pages should use the JSTL and EL instead.
 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It executed and gave the result without exception after I restarted netbeans this time. Thanks for the help!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!