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

displaying file in jsp  RSS feed

 
Ramesh Y Patil
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jsp/servlet application which uses the weblogic server. My application is creating text files from the user inputs. I am storing these files in a particular directory in unix. I need my jsp to display the text file on a click of a button. How do I get the file and display it?? All I know is the location and file name of the text file. Please help.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you come up with so far?
 
Ramesh Y Patil
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been thinking of using fileinputstream to read the the file. But I am not sure about it.
 
Ramesh Y Patil
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The fileiostream i think loads the file into app server memory. Is there any other way of doing it??
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at SimpleStream at http://simple.souther.us
It streams images from under the WEB-INF directory.

If your JPEGs are being created in a folder within your app, you can pretty much use it as is. If not, you can use a FileInputStreamt to get the stream and use the rest to ship it down to the browser.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!