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

loading values from a file  RSS feed

 
Harish Malavade
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have a jsp called SelectApi.jsp i want to load values from file as a InputStream and the file is located in one of my local drives. How to do this.

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not something you should be doing in a JSP. Moderne JSP should have no Java code within them.

In a servlet or other Java class, you can use normal Java file I/O.
 
Harish Malavade
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bibeault
Thanks for the reply.
I am not doing much processing in jsp. I just want to take data from the file, the location of which is been specified in properties file and i'm sending that input stream to the java class which will return me the hash map of key values defined in text file. Further displaying these key values in a html drop down. It works file when i do, config.getServletContext().getResourceAsStream("WEB-INF//Delilah_api_list.txt"); same thing i want to load file from my weblogic domain server.

Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!