• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt regarding maps key type while bnding

 
varun prakash
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic