Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

java hashmap 3 times the value

  • 27-07-2007 04:22PM
    #1
    Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭


    Im using a jsp to get a value from a hashmap.

    The problem is the value it's getting is 3 times what it should be.

    What could cause that?


Comments

  • Registered Users, Registered Users 2 Posts: 378 ✭✭sicruise


    Can you put up some of your code?

    The obvious answer is you multiplying it by 3 somewhere :)

    Are you using a jsp tag to itterate through the map?

    Try a bit of code like this, just to make sure you have the correct values in there...
    for ( String key : h.keySet() )
                {
                String value = h.get( key )
                System.out.println( "KEY : " + key + " VALUE : " + value );
                }
    

    Where h is a HashMap


  • Closed Accounts Posts: 161 ✭✭nude_hamster


    quinnd6 wrote:
    Im using a jsp to get a value from a hashmap.

    The problem is the value it's getting is 3 times what it should be.

    What could cause that?


    Ya a bit of code might help, right down and dandy :)


Advertisement