• Post Reply Bookmark Topic Watch Topic
  • New Topic

calling an external file  RSS feed

 
Nick Schneider
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have a question. My application is supposed to read from a text file and post data onto a web page. When I do this on my local machine i.e. localhost, I have no problems. However, when I try and deploy the application onto a server, I have been unable to read the file. Currently, the file and the WAR file sit in the same location, the same directory. Within my application, I have tried reading the file by relative pathing and absolute pathing to no avail. Is there an easy way to read an external file by the WAR file. Thanks for the help.

Nick
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you provide more information? What is this "application"? An applet, A Servlet? etc. And where are these files that you are trying to read?

Henry
 
Nick Schneider
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two parts to the application. The first part writes to a text file with a message and application link status (on, off). The second part is the web page which reads from the text file and displays a text message onto the web page and disables application links based on the status that is read. My question concerns that I have an index.jsp JSP that reads in a text message and boolean flags from a text file and render the page according to the values that are in the text file. I have no problems reading from the text file while on the localhost. When I deploy to the application server, the same index.jsp within the WAR file tries to read from the text file and it cannot. I've placed the text file and WAR file within the same directory. Hope that helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!