This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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 FileDownloadServlet.java is as:
my tomcat server display error message as follow:
Why the filedownloadservlet.java file call two times when click on open or save file dialog button at client side browser
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.
Joined: May 28, 2012
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. FileDownloadServlet.java 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.