Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Create a text area in a JSP page  RSS feed

 
Foni kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can someone suggest me how can I read a text file present in my local directory say (C://test.txt) , iterate and populate the values of test.txt into a text area of the JSP page? Can anyone provide any sample code in this context to get an understanding about the approach to be followed.

Contents in the test.txt file:
username:test
password:test123
domain:test321
DBname:testDB



Thanks and regards
Deb
 
K. Tsang
Bartender
Posts: 3624
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given the content of the file is database connection info, are you planning to allow users to update this or just read-only?

Is this the database your (web) app depend on? If so, why display it to users in the first place. Such info should be known by you only.

Also such info is best stored in properties file for easy reading/fetching.


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say "local" do you mean on the client or on the server?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!