Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Doubt regarding maps key type while bnding

Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic