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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets 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%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt regarding maps key type while bnding
 
Similar Threads
EJB QL RETURNING ONLY THE FIRST RECORD OF THE TABLE
Sorting a HasMap by Values
Map : Serious Doubt
Generics Implementation in Java SE 5
Beginning Spring: Syntax for Map<Integer, Double>?