aspose file tools
The moose likes Java in General and the fly likes To retreive values from property file which have the same key Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "To retreive values from property file which have the same key" Watch "To retreive values from property file which have the same key" New topic
Author

To retreive values from property file which have the same key

SmiR Raj
Greenhorn

Joined: Nov 29, 2005
Posts: 4
In a properties file "ApplicationResources.properties", I have many values having the same key. For Example
label.id = 10
label.id =11

Is there any way by which I can retrieve all the values referenced by the key label.id
I need to use this in a jsp.
is there any tag provided (by Struts)?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The underlying data structure for a java.util.Properties is a hashTable.
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html

HashTables can't have multiple elements with the same key.
One would overwrite the other.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13

Moved to Java in General (intermediate).


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: To retreive values from property file which have the same key
 
Similar Threads
Storing key-value pairs: Better apporaches for storing and reading?
Collections questions
Map having same keys ...
Need collection
save properties file without affecting existing comments.