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 8066379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:58:49+00:00 2026-06-05T11:58:49+00:00

i have a Map<ArrayList<String>, ArrayList<String> myMap = new HashMap<ArrayList<String>,ArrayList<String>>(); List<String> list1 = new ArrayList<String>();

  • 0

i have a

Map<ArrayList<String>, ArrayList<String> myMap = new HashMap<ArrayList<String>,ArrayList<String>>();

List<String> list1 = new ArrayList<String>();
list1.add("Administrator");
list1.add("Lookup Configuration");

List<String> list2 = new ArrayList<String>();
list2.add("User Creation");
list2.add("Branch Creation");
list2.add("Country");
list2.add("Language"):

the above is dummy data, i am creating menu management like this

Administrator (MenuName)
–User Creation (item1)
–Branch Creation (item2)
Lookup Creation (MenuName)
–Country (item1)
–Currency (item2)

i am writing jstl like this

Map,ArrayList> myMap = new LinkedHashMap,ArrayList>();

and i am doing like this

<c:forEach items="${mainMenu}" var="myMenu">
  <c:forEach items="${myMenu.key}" var="menuName" varStatus="loop">
    <li id="lookup" class="mail"><a href="#lookup">${menuName}<span>26</span></a>   
    <ul class="sub-menu">
      <c:forEach items="${myMenu.value}" var="items" varStatus="loop">
         <li><a href="#"><em>02</em>${items.itemName}<span>14</span></a></li>
      </c:forEach>                                            
    </ul>                   
    </li>
  </c:forEach>                                                                         
</c:forEach>

i am getting key perfect, but i am struck the value

and the values are not iterating the realted key
any help would be apreciated

Regards
Pradeep

  • 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-06-05T11:58:51+00:00Added an answer on June 5, 2026 at 11:58 am

    I am not sure, but maybe you want something like this:

    <%
    Map<String, List<String>> myMap = new LinkedHashMap<String,List<String>>();
    request.setAttribute("mainMenu", myMap);
    List<String> adminItemsList = new ArrayList<String>();
    adminItemsList.add("User Creation");
    adminItemsList.add("Branch Creation");
    
    List<String> lookupItemsList = new ArrayList<String>();
    lookupItemsList.add("Country");
    lookupItemsList.add("Language");
    
    myMap.put("Administrator", adminItemsList);
    myMap.put("Lookup Configuration", lookupItemsList);
    %>
    
    <c:forEach items="${mainMenu}" var="myMenu">
        <li id="lookup" class="mail"><a href="#lookup">${myMenu.key}<span>26</span></a>   
        <ul class="sub-menu">
        <c:forEach items="${myMenu.value}" var="item" varStatus="loop">
             <li><a href="#"><em>02</em>_${item}_<span>14</span></a></li>
        </c:forEach>                                            
        </ul>                   
        </li>
    </c:forEach>
    

    out:

    Administrator26

    • 02_User Creation_14
    • 02_Branch Creation_14

    Lookup Configuration26

    • 02_Country_14
    • 02_Language_14

    I used LinkedHashMap to remember order of keys i putted in Map.

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

Sidebar

Related Questions

I have set up a HashMap like so: Map<String, ArrayList<String>> theAccused = new HashMap<String,
I have a code like this Map<String, List> searchMap = new HashMap<String, List>(); for(int
i have some listview and SimpleAdapter List<HashMap<String, Object>> dataList = new ArrayList<HashMap<String, Object>>(); HashMap<String,
I have this ArrayList in Java - List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
I have the following ArrayList ArrayList<HashMap<String, String>> list; HashMap<String, String> map; with the following
Map<String, List<String>> words = new HashMap<String, List<String>>(); List<Map> listOfHash = new ArrayList<Map>(); for (int
I have a map: Map<String, String> ht = new HashMap(); and I would like
I have the map declared before onCreate public ArrayList<Map<String,String>> c_tmp= new ArrayList<Map<String,String>>(); public Map<String,String>
I have Map <A, List<A>> map = new HashMap<A, List<A>>(); Say I want to
I have created a Map as follows: private Map<String, List<Client>> clientCatalogue; this.clientCatalogue = new

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.