File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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%
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Doubt regarding maps key type while bnding