title: how to return two lists from controller class in spring mvc
body: <p>I have two tables call maintab,subtab for generate menubar.</p>
  
  <pre><code>maintab has 
  
  maitabId ,main_tab_name
  
  subtab has:
  sub_tb_ID  ,main_tb_id,subtab_name ,Url
  </code></pre>
  
  <p>I want to get two list containig list1=maintabid  &amp; maintabname</p>
  
  <pre><code>list2=subtabname,maintabID &amp; url
  </code></pre>
  
  <p>I want to return the two list using spring mvc. And retrieve in jsp page to populate a menu.Please give me a code of controller class and jsp: i use hibernate and tile to this sample.</p>
  
  <p>i tired </p>
  
  <pre><code>public String listmaintabAndsubtabs(Map&lt;String, Object&gt; map) {
  
          map.put("maintab", new maintab());
          map.put("maintabList", contactService.listmaintab());
  
          return "maintab";
      }
  </code></pre>
  
  <p>how to  to return subtabs and main tabs both by one method....</p>