Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt regarding maps key type while bnding  RSS feed

varun prakash
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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,
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!