File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "error "The system cannot find the file specified"" Watch "error "The system cannot find the file specified"" New topic

error "The system cannot find the file specified"

sudarshan jadhav
Ranch Hand

Joined: May 28, 2012
Posts: 42
Hello everyone ,
Please help me i am download a server path file at client side using servlet response object but when file open and save dialog box open and click on save or open button the error is display at tomcat server file not found .My code is working successful and delete a file from server path but at console file not found exception is display 2 times why 2 times java file is called and error is display at console
My code is follow one jsp and one servlet file is:

when click on submit button a server path file is download to client browser using respose object of servlet. The is as:

my tomcat server display error message as follow:

Why the file call two times when click on open or save file dialog button at client side browser
nalla srinivas

Joined: Jan 10, 2013
Posts: 9
put the downloaded file in the tomcat root dierectory or get the file object using getResource() from the servlet context object.

refer servletContext methods you will get a solution.
sudarshan jadhav
Ranch Hand

Joined: May 28, 2012
Posts: 42
Thank you nalla srinivas for reply
I have create a file at c:\XMLFiles\filename.xml server path successfully but when access these file to client side computer click on save button browser show file save dialog box is open a save or open button click the file is save or open successfully at client side but the problem is servlet code i.e. is run two times and error message is display at tomcat file not found at c:\XMLFiles\filename.xml because the file is save at client side after that process server side same file is deleted successfully and error is display at console.
Gaurangkumar Khalasi
Ranch Hand

Joined: Jun 02, 2012
Posts: 187
What is "hidetable()" function??? Maybe problem arise because of it!!!
I agree. Here's the link:
subject: error "The system cannot find the file specified"
It's not a secret anymore!