wood burning stoves 2.0*
The moose likes JSF and the fly likes Doubt regarding  maps key type while bnding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Doubt regarding  maps key type while bnding" Watch "Doubt regarding  maps key type while bnding" New topic
Author

Doubt regarding maps key type while bnding

varun prakash
Greenhorn

Joined: Oct 12, 2006
Posts: 17
Hi,

I'm doing value binding for Input text using a map.When i click the submit button, a new entry is added to the map with the key of 100, but the type of key is Long.
so my ques is: If i have a map with a number as key,will it be converted to Long by default, instead of Integer.Any reason for this behaviour?

Code Snipppet:

<h:inputText id="map" value="#{bandDetail.extraArgsMap[100]}"/>

java code:
@Name( "bandDetail" )
public class BandDetail
{
private Map<Integer, Object> extraArgsMap = new HashMap<Integer, Object>();

public Map<Integer, Object> getExtraArgsMap()
{
return extraArgsMap;
}
}

Thanks in Advance,
VarunJ


SCJP - 98%<br />SCWCD - 89%
 
wood burning stoves
 
subject: Doubt regarding maps key type while bnding
 
Similar Threads
Map : Serious Doubt
Sorting a HasMap by Values
EJB QL RETURNING ONLY THE FIRST RECORD OF THE TABLE
Generics Implementation in Java SE 5
Beginning Spring: Syntax for Map<Integer, Double>?