| Author |
integer from properties file
|
nagesh siddu
Greenhorn
Joined: Nov 09, 2005
Posts: 6
|
|
hi all, i needed to read two integers from property file into a JSP. has any one got an example for this? regards, Nagesh
|
 |
Scott Selikoff
Saloon Keeper
Joined: Oct 23, 2005
Posts: 3652
|
|
Check out java.util.Properties.load(). Its a general method to read properties files from an InputStream and load them into a Properties object set. Depending on where the data is coming from (the user, server, specific file location, etc) your code to read the file as and send it to a stream will vary.
|
My Blog: Down Home Country Coding with Scott Selikoff
|
 |
Adeel Ansari
Ranch Hand
Joined: Aug 15, 2004
Posts: 2874
|
|
Originally posted by nagesh siddu: i needed to read two integers from property file into a JSP. has any one got an example for this?
You get those integer values as string then after getting, you have to covert those into Integer/int, as per your requirement, in your code.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56166
|
|
|
Not really JSP-specific, so moved.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Adam Richards
Ranch Hand
Joined: Nov 03, 2005
Posts: 133
|
|
|
In a universe far, far away, I approached this by extending the Properties class & addding getters & putters for specific datatypes. For example:
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
What you can also do is the following:
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: integer from properties file
|
|
|