aspose file tools*
The moose likes Spring and the fly likes Beginning Spring: Syntax for Map<Integer, Double>? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Beginning Spring: Syntax for Map<Integer, Double>?" Watch "Beginning Spring: Syntax for Map<Integer, Double>?" New topic
Author

Beginning Spring: Syntax for Map<Integer, Double>?

H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
    
    4


Using Spring, is it possible to creat a Map<Integer, Double>? If so, what is the syntax? Any pointer.
so that I can percentageLookup = springContext.getBean("percentageLookup");


With above config, the key is of type String, String.

percentageLookup.get("100") = 2
percentageLookup.get(100) = null

1M Thanks.
N Sahni
Ranch Hand

Joined: Jul 07, 2011
Posts: 55

Hi,

You can try modifying your Map creation in spring as:


Thanks and Regards,
Nilesh Sahni | nsahni@infocepts.com | www.infocepts.com
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
    
    4
1. Suggested code works.
2.

Some where we refer Pricer.DEFAULT_PCT.

Syntax-wsie: How can it be declared in Spring configuration file and refer to it?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

H Paul wrote:1. Suggested code works.
2.

Some where we refer Pricer.DEFAULT_PCT.

Syntax-wsie: How can it be declared in Spring configuration file and refer to it?


You can use the <util:constant> tag to use a constant value in your configuration.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Beginning Spring: Syntax for Map<Integer, Double>?