• Post Reply Bookmark Topic Watch Topic
  • New Topic

I can list server text files, but cannot bring them up to display

 
Ron Rea
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From within my webapp, I need to access a Unix directory outside of the webapp that contains report files (with a .txt extension).
I can read the file directory in a servlet, retrieve the file names, and present the names in a JSP, but I cannot figure out how to allow the user to click on a specific report file and have it displayed in the browser.
Anyone know how to do this?
Thanks!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35743
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you list the files, include each one in a hyperlink. The link should have a unique identifier (such as the file name.)

FileDisplayServlet would set the content type, read the lines from the servlet and write them out. Then the user will see them on the screen.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!