Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1041349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:20:22+00:00 2026-05-16T15:20:22+00:00

I have a HashMap (hshFields) of HashMaps (ecd_date, owned_by, etc..) with keys (label, size,

  • 0

I have a HashMap (hshFields) of HashMaps (ecd_date, owned_by, etc..) with keys (label, size, etc..that I access as such:

<c:out value="${hshFields.ecd_date.label}" />
<c:out value="${hshFields.owned_by.label}" />
<c:out value="${hshFields.fnd_source.label}" />

(note: I must use JSTL and not EL)

the about spits out the a “label” of the field (maintained in an XML map) i.e.:

commitment_id = Commitment Id 
owned_by = Commitement Owner
fndsource = Funding Source

I’d like to now use a jstl forToken to loop over the nested HashMap. But I can not get it to work. Here is one of my attempts:

 <c:forTokens items="commitment_id, owned_by, fndsource" delims="," var="curField">
    The Field Label is: <c:out value="${hshFields.${curField}.label}" /> <br />
    The Field Sixze is: <c:out value="${hshFields.${curField}.size}" /> <br />
</c:forTokens>

Is this not working because Of incorrect syntax or hopefully not because I don’t have EL capability??

EDIT
OK based on skaffman’s response below I have:

<c:forTokens items="owned_by, ecd_date, commitment_id" delims="," var="curField">
  Label for <c:out value="${curField}" /> : <c:out value="${hshFields[curField].label}" /><br></br>
</c:forTokens>

and the output is:

Label for owned_by : Commitment Owner
Label for ecd_date : 
Label for commitment_id : 

It seems to be working only on the first token because if I use the following:

Label for owned_by : <c:out value="${hshFields.owned_by.label}" /> <br></br>
Label for ecd_date : <c:out value="${hshFields.ecd_date.label}" /> <br></br>
Label for commitment_id : <c:out value="${hshFields.commitment_id.label}" /> <br></br>

I get this output:

Label for owned_by : Commitment Owner
Label for ecd_date : Estimated Completion Date
Label for commitment_id : Commitment Number
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:20:22+00:00Added an answer on May 16, 2026 at 3:20 pm

    Your syntax isn’t quite right, it should be

    <c:out value="${hshFields[curField].label}" />
    

    rather than

    <c:out value="${hshFields.${curField}.label}" />
    

    Nested EL expressions like that isn’t permitted.

    updated: The reason it’s only working for the first iteration in the loop is because you have spaces as well as commas in your items list, and the delims only handles the commas. So change the loop to

    items="commitment_id,owned_by,fndsource"
    

    rather than

    items="commitment_id, owned_by, fndsource"
    

    Otherwise, the spaces will form part of the individual loop values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a hashmap that is 101 keys in size, but I know for
I have HashMap 1, which contains 5 keys, all of which have Hashmaps as
I have hashmap and its keys are like folder/1.txt,folder/2.txt,folder/3.txt and value has these text
I have hashmap that has keys like this:'2+4+5' , '653+65+1324+75'.(integer values delimited by a
I have a HashMap that I'm using in Processing and I'd like to increment
I have a HashMap where the key is a word and the value is
I have a hashmap with some information(key and value) in a perl file. I
I have a hashmap that contains multiple string arrays. I am trying to output
I have a HashMap with the addresses and the names of the clients that
If I have a HashMap that looks like this: HashMap<String, MyObject> where the String

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.